[jdom-interest] Problem to read xml with jdom when CR
Edelson, Justin
Justin.Edelson at mtvn.com
Fri Apr 21 07:25:03 PDT 2006
I can't duplicate this at all. I put your xml fragment in a file, parsed
it, and output as follows:
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new FileReader("jdom-test2.xml"));
XMLOutputter outputter = new XMLOutputter();
Element root = doc.getRootElement();
System.out.println(root.getName() + " <-- root element is class");
System.out.println(root.getChildren("description") + " <-- description
is a child element of class");
outputter.output(root.getChild("description"), System.out);
Which produces
class <-- root element is class
[[Element: <description/>]] <-- description is a child element of class
<description>From Cello MIM.
Ref. [MOM_Cello]</description>
________________________________
From: Mikael Petterson (KI/EAB) [mailto:mikael.petterson at ericsson.com]
Sent: Friday, April 21, 2006 10:18 AM
To: Edelson, Justin; jdom-interest at jdom.org
Subject: RE: [jdom-interest] Problem to read xml with jdom when CR
Hi,
It seems like the parser interprets <description> as a child on the same
'level' as <class> in the latter case.
Helpful enough?
cheers,
//mikael
________________________________
From: jdom-interest-bounces at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of Edelson, Justin
Sent: den 21 april 2006 15:41
To: jdom-interest at jdom.org
Subject: RE: [jdom-interest] Problem to read xml with jdom when CR
Can you explain what you mean by "cannot read"?
________________________________
From: jdom-interest-bounces at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of Mikael Petterson
(KI/EAB)
Sent: Friday, April 21, 2006 7:56 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Problem to read xml with jdom when CR
Hi,
When we read one version of the xml we had the following:
<class name="Aal0TpVccTp">
<description>From Cello MIM.
Ref. [MOM_Cello]</description>
<systemCreated/>
<attribute name="Aal0TpVccTpId">
<mandatory/>
<noNotification/>
<restricted/>
<dataType>
<string/>
</dataType>
</attribute>
</class>
In the new version of the xml we have the following that jdom cannot
read ( carriage return after MIM):
<class name="Aal0TpVccTp">
<description>From Cello MIM.
Ref. [MOM_Cello]</description>
<systemCreated/>
<attribute name="Aal0TpVccTpId">
<mandatory/>
<noNotification/>
<restricted/>
<dataType>
<string/>
</dataType>
</attribute>
</class>
Any ideas if this is a known problem ? Or if there is a workaround for
it?
Cheers,
//mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060421/d58a0b90/attachment.htm
More information about the jdom-interest
mailing list