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

Well, each ROW has one element child, so the for-each select="*" selects one node, and the position of that node is always 1. So $pos is always 1. $ItemIndex is a sequence of integers of length 1 (specifically, a singleton integer whose value is zero), so $ItemIndex[$pos] is the first integer in this sequence, which is zero. I've no idea what you had in mind when you wrote this code.

Try:

Code:
<xsl:template match="ROW">
  <xsl:number/>
  <xsl:value-of select="ERROR_MESSAGE"/>
</xsl:template>
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote