I have a following XML
<?xml version="1.0" encoding="UTF-8"?>
<stationary>
<textbook>
<name>test</name>
</textbook>
<notebook>
<books>
<name>test</name>
</books>
</notebook>
</stationary>
I am trying to get all name
elements irrespective of their position in stationary
I have tried using the following syntax but it didn't work:
stationary/*/name/text()
Try this :
'stationary//name/text()'
Just use the following expression with a relative path:
//name
This seems to capture the two <name>
tags you have in your XML sample:
Element='<name>test</name>'
Element='<name>test</name>'
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