[Home] [By Thread] [By Date] [Recent Entries]
On 26/08/2012 09:07, Michael Kay wrote:
I overlooked that what you are trying to do is to get the position of the node with a given @id value, rather than a node whose identity is known ($node). In XPath 2.0, if every node has an @id attribute, and if the nodes are in document order, you could use index-of($nodes/@id, 'foo') If some nodes have no id attribute, or if you want to avoid sorting the nodes into document order, you could vary this to index-of($nodes/string(@id), 'foo') Michael Kay Saxonica
|

Cart



