My goal is to extract specific nodes from multiple XML files with multiple namespaces using XPath. Everything works fine as long as I know the namespace URI. The namespace name itself remains constant, but the schemes (XSD) are sometimes generated by the client, that is, they are unknown to me. Then I remain basically three options:
use only one schema for the namespace, hoping that nothing will work (can I be sure?)
get the child nodes of the document and look for the first node with the namespace URI, hoping that it is there, and just use the URI, hoping that it is correct. may go wrong for several reasons
somehow say xpath: "Look, I don't care about namespaces, just find ALL nodes with that name, I can even name the namespace, not the URI." And here is the question ...
This is not a repetition of the numerous “my xpath expression does not work because I am not aware of namespace awareness”, as found here or. I know how to use namespace understanding. Just not how to get rid of it.
xml namespaces xpath xml-namespaces
kostja Dec 14 2018-10-14 14:57
source share