I'm trying to find a nice solution to search in xml-documents by using XPath. The problem I'm facing are the different xml-documents I'm receiving. Some of them use namespaces and others don't but they all have the same structure.
What I've done so far: I registered a namespace a: with the received namespace and all of my queries look like xpath('a:query') but when a document without namespace is being received I don't know what to register a: with because I don't want to create two different xpath-queries (one with and one without namespace).
Stackoverflow has a lot about ignoring the namespace completely but this is not a nice option. What other options are possible?
Thanks a lot.