View Single Post
  #5 (permalink)  
Old July 6th, 2009, 08:13 AM
mhkay's Avatar
mhkay mhkay is offline
Wrox Author
Points: 12,735, Level: 48
Points: 12,735, Level: 48 Points: 12,735, Level: 48 Points: 12,735, Level: 48
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 Posts
Default

>Same answer:

<Revision><Number><xsl:value-of select="$OtherSource[position()]"/></Number></Revision>

Umm, no: it needs to be

<Revision><Number><xsl:variable name="pos" select="position()"/><xsl:value-of select="$OtherSource[$pos]"/></Number></Revision>

because position() changes its value inside a predicate.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference

Last edited by mhkay : July 6th, 2009 at 08:13 AM. Reason: correction
Reply With Quote
The Following User Says Thank You to mhkay For This Useful Post:
chandra_perni (July 6th, 2009)