> There is needed, ... > the ability for position() to take a node as an argument, and > return the -relative- position. > For example: > <xsl:value-of select="position(following-sibling::truck[1])" /> > > would return: "3" The result, of course, is a function not only of the target node, but of the axis by which it was reached; and presumably it would count all nodes along that axis (including comments), rather than merely counting elements? Defining such a function would get very complex and might well give answers that were intuitively wrong in many cases. I think a much more general capability is the idea of a "truncated axis", so you could select the node-set leading(following-sibling::*, [not(self::truck)]) which selects all following sibling elements up to the first one that is a <truck>, and then you can do count() on this to get your position() function. If you want to play with this, there's an extension function saxon:leading() that works like this in Saxon. Mike KayReceived on Wednesday, 31 January 2001 13:12:06 GMT
This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT