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

[no subject]

[no subject]
	<div id="rulesListTOC">
		<ul>
		<xsl:for-each select="ruleItems/ruleItem">
			<xsl:call-template name="rulelistTOC" />
		</xsl:for-each>
		</ul>
	</div>

<xsl:template name="rulelistTOC">
<xsl:for-each select="ruleItem">

		<li><a href="#{position()}"><xsl:value-of
select="number" />: <xsl:value-of select="title" /></a>
			<xsl:if test="ruleItem">
				<ul>
					<xsl:call-template
name="rulelistTOC" />
				</ul>
			</xsl:if>
		</li>
</xsl:for-each>
</xsl:template>


The problem is that the 'position()' is reset during each loop of the
recursion. So my links end up as:

1
  1
  2
2
3

Is there a way around that? Or, perhaps to ask the question more
generally, what method would people recommend for creating a unique
number for each node of the recursive loop?

The 'easy' solution would be for me to just store the unique ID stored
in the database for each node within the XML itself, but I was wondering
if there was a solution on the XSL side of things before I recreate the
XML files.

-Darrel

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.