I have been using Labview's native XML parser to read an XML document. As it turns out, it is too slow for large files. I therefore am trying to use LibXML as it seems to be quite popular. However, I am having trouble with namespaces. I have a third-party XML document that comes like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<foo xmlns="urn:foo_Schema_V3">
<bar>
<fooID description="XML Test 170731"></fooID>
<barNumber>60</barNumber>
</bar>
</foo>
and would like to select the barNumber using Labview which uses XPath.
The content text should be 60, however it remains empty. I read up a little and assume this is due to namespace issues in LibXML. As a test, I changed the second line in XML to
<foo xmlns:cliff="urn:foo_Schema_V3">
suddenly, the XPath expression works even though cliff is never even mentioned in Labview.
Q: How can I select the node I want without having a namespace prefix?
Update: I have taken to using
/*[local-name()='foo']/*[local-name()='bar']/*[local-name()='barNumber']
, which is not elegant and does not explain WHY a node is not selectable without prefix.