Hi folks,
is there a XPath function, which returns the absolute path of an element, so I can use it in sth. like:
<xsl:if test="path() = /root/parent/child">
...
</xsl:if>
Thanks.
Hi folks,
is there a XPath function, which returns the absolute path of an element, so I can use it in sth. like:
<xsl:if test="path() = /root/parent/child">
...
</xsl:if>
Thanks.
No, there isn't, but such expression '. = /root/parent/child' returns boolean and means the same.
If you want to test if two nodes are the same, you must use generate-id():
<xsl:if test="generate-id(.) = generate-id(/root/parent/child)">
<!-- The current node is the same as /root/parent/child -->
...
</xsl:if>
generate-id() returns an unique ID for each node of the document.