|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] My Difficult counting problem
hello,
I need some help doing the following, I can't seem to figure out how to do
this in XSL
I need to convert something like this
<myElement>
<foo name="foobar1"/>
<foo name="foobar2"/>
<foo name="foobar1"/>
<foo name="foobar3"/>
<foo name="foobar1"/>
<foo name="foobar1"/>
<foo name="foobar3"/>
</myElement>
and the output after running it through the XSL would be
numberOccurrences[] = {1, 1, 2, 1, 3, 4, 2};
basically for each foo with a duplicate name you put the occurrence number
of it in the array at the correct position.
You see that foobar1 occurs 4 times,
the 1st occurrence is at position 0, while 2nd occurrence is at position 2,
3rd at position 4, and 5th at position 5. etc.
I don't know how loop through the nodes, and keep track of how many
occurrences there are up to the given position.
help!!
thanks
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








