This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

position()


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>
&lt;!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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]