This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
assigning sequence numbers to repeated tags.
- From: Edward dot Middleton at nikonoa dot net
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 17 Jan 2002 11:01:33 +0900
- Subject: [xsl] assigning sequence numbers to repeated tags.
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi All
I have a sequence of tags, some repeating, in no particular order
<parenttag>
<othertag/>
<tag attrib="1"/>
<tag attrib="2"/>
<tag attrib="2"/>
<tag attrib="3"/>
<tag attrib="4"/>
<tag attrib="4"/>
<tag attrib="5"/>
<tag attrib="2"/>
<tag attrib="5"/>
<tag attrib="5"/>
<tag attrib="6"/>
</parenttag>
I need to loop through all repeated tags (with the same attrib number) and add a number reference to the attrib value.
e.g.
<parenttag>
<othertag/>
<tag attrib="1"/>
<tag attrib="2"/> => <tag attrib="2[1]"/>
<tag attrib="2"/> => <tag attrib="2[2]"/>
<tag attrib="3"/>
<tag attrib="4"/>
<tag attrib="4"/>
<tag attrib="5"/>
<tag attrib="2"/> => <tag attrib="2[3]"/>
<tag attrib="5"/>
<tag attrib="5"/>
<tag attrib="6"/>
</parenttag>
Furthermore, I don't know the values of the attrib's in advance so I need the rule to use the attrib values found in the document.
Thanks in advance
Edward
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list