[jdom-interest] Parse errors unless comment added
Fred Clewis
clewisf at us.ibm.com
Wed Jan 16 09:02:42 PST 2002
I'm using JDOM b7 and xerces with JRE 1.2.2. I don't think it's a JDOM
problem but I would appreciate any ideas. My problems is that I get the
error:
------------------------------------
[Fatal Error] :-1:-1: XML document structures must start and end within the
same
entity.
XMLMessage(String) constructor JDOM exception
org.jdom.JDOMException: Error in building from stream: XML document
structures m
ust start and end within the same entity.
at org.jdom.JDOMException.<init>(JDOMException.java:119)
at org.jdom.input.DOMBuilder.build(DOMBuilder.java:279)
at
com.ibm.mqsfse.tools.XMLMessage.buildDocumentFromString(XMLMessage.ja
va:96)
-----------------------------
when I use the code below with either DOM or SAX:
----------------------------
DOMBuilder builder = new DOMBuilder();
//SAXBuilder builder = new SAXBuilder();
builder.setValidation(false);
thisDocument = builder.build(new ByteArrayInputStream(string.getBytes()));
------------------------------
to read the xml below if the comment is removed. It works with the comment
as shown. I have also determined that the problem is related to the
consolidated tag syntax: <SystemBackupList/>
-----------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Message id="M11292064" version="1.4" bodyType="HUBONLYOFFLINE"
sourceLogicalId="FrontEnd" authenticationId="USERID">
<COMMAND cmdType="GetSystemProfile">
<!--filename=GetSystemProfile.xml-->
<SystemSymbolic>FrontEnd</SystemSymbolic>
<SystemBackupList/>
<Language>10</Language>
<Result>Success</Result>
</COMMAND>
</Message>
does this weirdness sound familiar to anyone?
thanks,
Fred Clewis
More information about the jdom-interest
mailing list