Monday, 15 July 2013

xslt - Get the path of an element -


There is an XPath function, which returns the full path of an element, so I can use it in sth. Like:

  & lt; Xsl: if test = "path () = / root / parent / child" & gt; ... & lt; / Xsl: if & gt;  

Thanks.

If you want to test two nodes are identical, use the Generate-ID () Will be:

  & lt; Xsl: if test = "gener-id (.) = Generate-id (/ root / parent / child)" & gt; & Lt ;! - Current node / root / parent / child - & gt; ... & lt; / Xsl: if & gt;  

Generate-id () returns a unique ID for every node in the document.


No comments:

Post a Comment