B
badgerduke
I am trying to parse well-formed XML into Document objects. I thought
the parser would figure out that there was a document root, but it
assumes the root to be <HTML> with a child element of <BODY> which in
turn has as a child the XML I actually parsed.
Unfortunately, I am not allowed to show code but it goes like this:
<nms:MyRoot>
.....
</nms:MyRoot>
is parsed using org.apache.xerces.parsers.DOMParser and comes out as:
<HTML>
<BODY>
<NMS:MYROOT>
....
</NMS:MYROOT>
</BODY>
</HTML>
This has never happened to me before. What is even more strange is
this:
Element originalRoot = (Element) ((NodeList)
parsedDoc.getElementsByTagNameNS("NMS", "MYROOT")).item(0);
originalRoot evaluates to null!
Nothing about my code suggests HTML . . . its just a few lines I've
typed before. any ideas?
the parser would figure out that there was a document root, but it
assumes the root to be <HTML> with a child element of <BODY> which in
turn has as a child the XML I actually parsed.
Unfortunately, I am not allowed to show code but it goes like this:
<nms:MyRoot>
.....
</nms:MyRoot>
is parsed using org.apache.xerces.parsers.DOMParser and comes out as:
<HTML>
<BODY>
<NMS:MYROOT>
....
</NMS:MYROOT>
</BODY>
</HTML>
This has never happened to me before. What is even more strange is
this:
Element originalRoot = (Element) ((NodeList)
parsedDoc.getElementsByTagNameNS("NMS", "MYROOT")).item(0);
originalRoot evaluates to null!
Nothing about my code suggests HTML . . . its just a few lines I've
typed before. any ideas?