The question is quite silly, but I am completely stuck. I want to extract child nodes of a node based on a condition. The XML is as follows:
<a> <aCode>aaa</aCode> <aValue>bbb</aValue> </a>
The expression is obvious: //a[aCode='aaa']
But I can't get how I should change it if it is with namespaces and I've got to use local-name()
. I've tested the following and it gives a parsing error:
/*[local-name()='a'][[local-name()='aCode']='aaa']
Has anyone any idea of what I should do?
The local-name function returns a string representing the local name of the first node in a given node-set.
You probably meant
//*[local-name()='a'][*[local-name()='aCode']='aaa']
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