Name

[T] print-node-xpath — Display the path of a node

Synopsis

<xsl:template name="print-node-xpath">
  <xsl:param name="node" select="." /></xsl:template>

This template displays the address of the given node in XPath notation, in a compact yet unambiguous form suitable for diagnostics to the user.

It assumes that ID attributes are named id, and if an element has an ID defined, then the element will be addressed using that ID, instead of a long XPath starting from the root.

Parameters
node

The node to get to trace the path to. Default is the context node.