[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XPath to find duplicate elements
On 05.04.2018 18:12, Leo Studer leo.studer@xxxxxxxxxxx wrote:
I have an xml file where I need and XPath expression to find all elements that are a copy of a previous element in the same file. The code with $xml := <a>...</a> looks like XQuery to me, not like XSLT or XPath. That aside, what do you want pseudo syntax preceding-sibling::element(node-name(.)) to compute? If you want to select all elements and compare them to the node-name() of another node you can certainly use preceding-sibling::*[node-name() = node-name($n)] where you simply would need to make sure you define $n previously with a "let", as you have done at another place in your code. Also XPath now has a "path" function which returns an XPath expression with positional predicates so perhaps you don't need to construct the name/position pairs on your own if you have access to the latest XPath version.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|