Re: [xsl] Using position() to retrieve corresponding value in another node

Subject: Re: [xsl] Using position() to retrieve corresponding value in another node
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 31 Jan 2011 01:02:44 +0000
if you use a numeric constrict in a filter like
 field[1]
it is short for the predicate
field [position()=1]

so if you go

field[position()]

it's short for


field[position()=position()]


and the predicate is always true.

You want

<xsl:for-each...>
  <xsl:variable name="p" select="position()"/>
  <xsl:value-of select=....field[position()=$p]



David

Current Thread