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

assigning sequence numbers to repeated tags.

Subject: assigning sequence numbers to repeated tags.
From: Edward.Middleton@xxxxxxxxxxx
Date: Thu, 17 Jan 2002 11:01:33 +0900
xslt assigning a sequence number
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


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-2013 All Rights Reserved.