functx:path-to-node-with-pos
A unique path to an XML node (or sequence of nodes)
Description
The functx:path-to-node-with-pos function returns a path to that node, starting with the root element. Specifically, it will concatenate all the names of its ancestors, using a forward slash as a separator. If an element with that name appears more than once in a parent, a predicate is included to indicate the sequence number of that particular node.
Parameters |
Description |
---|---|
node:node() |
the node sequence |
Examples
XPath |
Results |
---|---|
functx:path-to-node-with-pos($in-xml//lName[. = ‘Doe’]) |
authors/author[2]/lName |
functx:path-to-node-with-pos($in-xml/*[1]) |
authors/author[1] |