I have an xml which is something like
<A>
<B>
<C1>
<D> some text 1 </D>
</C1>
<C2>
<D> some text 2 </D>
</C2>
</B>
</A>
I want to use a wildcard to get the text of all D element nodes. I tried /A/B/*/D/text() but it doesnt seem to work. Help appreciated.
Use the // oprator. It will give you all the D elements in the document.
//D/text()
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