[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Counting common value within specific attributes

Subject: Counting common value within specific attributes
From: "Andrew Quan" <aquan@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Apr 2006 12:40:40 +1000
andrew quan
Hi,

I'm Using XSLT 1.0

I've searched around in the FAQ and i couldnt find any information regarding
this issue - hopefully I can get some help, although I feel like I may have
not structured my question correctly... I hope you understand it. I'm a
relative beginner too, so that probably doesnt help either. Sorry!

Given a data set similar to this:

<device>
    <deviceID>1</deviceID>
    <desc>Description1</desc>
    <chan1>0<chan1>
    <chan2>0<chan2>
    <chan3>2<chan3>
    <chan4>2<chan4>
    <chan5>2<chan5>
    <chan6>2<chan6>
    <chan7>4<chan7>
    <chan8>0<chan8>
    <chan9>2<chan9>
</device>
<device>
    <deviceID>2</deviceID>
    <desc>Description2</desc>
    <chan1>2<chan1>
    <chan2>2<chan2>
    <chan3>2<chan3>
    <chan4>4<chan4>
    <chan5>2<chan5>
    <chan6>2<chan6>
    <chan7>2<chan7>
    <chan8>2<chan8>
    <chan9>4<chan9>
</device>

Is there a way to count how many times, for example, a 2 appears in all
attributes starting with the name "chan"?

Ideal output:

Device ID | Description | Channels=0 | Channels=2 | Channels=4 |
1	| Description1	| 3 | 5 | 1 |
2 	| Description2    | 0 | 7 | 2 |

Any help appreciated, i'll keep searching till then
Andrew

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.