I have following xml file:
<Dictionary>
<words>
<word>AM</word>
</words>
<words>
<word>AN</word>
</words>
<words>
<word>AN</word>
</words>
</Dictionary>
I need xpath to find duplicate word nodes like in above "AN" is duplicate. I tried following from web search but it did not work:
/*/*[index-of(/*/*/word(), word())[2]]
Select word that exists the same word before
/Dictionary/words/word[.= ../preceding-sibling::words/word]
With following
axis:
//words/word[. = ./following::word]
https://www.w3.org/TR/1999/REC-xpath-19991116/#axes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With