Sometimes I have an XML:
<resource
xsi:schemaLocation="http://www.test.com/resource http://test.com/schema/resource
xmlns="http://www.test.com/resource"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
...
</resource>
and sometimes w/o the namespace URIs, i.e.
<resource>
...
</resource>
How to make fetch all child elements of resource
no matter the namespace URIs?
I am using nu.xom.Element
to handle elements and I build a nu.xom.Document
this way:
nu.xom.Builder parser = new nu.xom.Builder();
return parser.build( new ByteArrayInputStream(xmlString.getBytes()) );