1
有时候,我有一个XML:获取所有子元素忽略空间URI
<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>
有时W/O的命名空间的URI,即
<resource>
...
</resource>
如何使获取的resource
所有子元素无与命名空间URI有关吗?
我使用nu.xom.Element
处理元素和我建立一个nu.xom.Document
这样:
nu.xom.Builder parser = new nu.xom.Builder();
return parser.build(new ByteArrayInputStream(xmlString.getBytes()));
你如何正在分析文件? – Djon
更新了说明 – Yanko