This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
position()
- To: "xsl list" <xsl-list at mulberrytech dot com>
- Subject: position()
- From: "Dave Pawson" <dave dot pawson at virgin dot net>
- Date: Sun, 16 Apr 2000 08:17:41 +0100
- Reply-To: xsl-list at mulberrytech dot com
I'm using position() function in two places.
Once in the root template in a for-each loop.
<xsl:for-each select="faq/body/section" >
<xsl:variable name="num" select="position()"/>
<xsl:variable name="secno">Section<xsl:value-of
select="$num"/></xsl:variable>
<!ENTITY <xsl:value-of select="$secno"/> SYSTEM "<xsl:value-of
select="$secno"/>.xml">
</xsl:for-each>
Once in a template
<xsl:template match="section" >
<xsl:variable name="secno"><xsl:value-of
select="position()"/></xsl:variable>
Problem.
The 'number' I'm getting back is different in each case.
In the former case I get 1 to 7,
in the latter case I get 2 6 10 14 18 22 26
Can anyone suggest why they are different please?
Regards, DaveP
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list