Subject: Re: [xsl] Obtaining a specific context position() From: "Mark Wilson" <mark@xxxxxxxxxxxx> Date: Sun, 8 Nov 2009 14:59:03 -0800 |
Thanks, Mark
-------------------------------------------------- From: "David Carlisle" <davidc@xxxxxxxxx> Sent: Sunday, November 08, 2009 2:35 PM To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: [xsl] Obtaining a specific context position()
the value returned by position() is unrelated to the position of the node in the source tree, it is just a function of the context selected by the current xpath (for example if you select a node with . then it has position()=1 whevever it appears in the source)
It's not clear really what you want for the subdiv version, in your posted sample it was the same value as in the heading, in which case you can just save it in a variable and use it twice.
<xsl:variable name="h" select="position()"/>
<Heading> <xsl:value-of select="$h"/> <!-- first call --> </Heading>
<xsl:for-each-group select="current-group()" group-by="SubDiv1">
<xsl:sort select="current-grouping-key()" collation="{$sorting-collation}"/>
<SubDiv1> <xsl:value-of select="$h"/> <!-- second call -->
David
________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Obtaining a specific cont, David Carlisle | Thread | [xsl] transforming xml data in cdat, road speeder |
Re: [xsl] Obtaining a specific cont, David Carlisle | Date | [xsl] transforming xml data in cdat, road speeder |
Month |