RE: About position() in xsl:for-each-group
> Am I the only one to find odd that "position()" evaluates to > the position of the current group instead of 1, i.e., the > position of the first city in the current group (contrast > with "@country")? It seems logical to me: xsl:for-each-group iterates over the groups, so it makes sense that within the body of the instruction, position() ranges from 1 to last(), and last() gives the number of iterations. This provides a way of numbering the groups, knowing how many groups there are, testing whether the current group is the last, and so on. @country is a property of a node. position() is not a property of a node, it is a property of an iteration over a sequence. So it's reasonable that they should behave differently. Michael Kay http://www.saxonica.com/
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format