<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Problem to read xml with jdom when CR</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=575032114-21042006>I can't duplicate this at all. I put your xml fragment
in a file, parsed it, and output as follows:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff><SPAN class=575032114-21042006><SPAN
class=575032114-21042006><FONT face=Arial
size=2></FONT></SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff><SPAN class=575032114-21042006><SPAN
class=575032114-21042006><FONT face=Arial size=2>SAXBuilder builder = new
SAXBuilder();<BR>Document doc = builder.build(new
FileReader("jdom-test2.xml"));<BR>XMLOutputter outputter = new
XMLOutputter();<BR>Element root =
doc.getRootElement();<BR>System.out.println(root.getName() + " <-- root
element is class");<BR>System.out.println(root.getChildren("description") + "
<-- description is a child element of
class");<BR>outputter.output(root.getChild("description"),
System.out);</FONT></SPAN></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff><SPAN class=575032114-21042006><SPAN
class=575032114-21042006><FONT face=Arial size=2>Which
produces</FONT></SPAN></SPAN></FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff><SPAN class=575032114-21042006><SPAN
class=575032114-21042006><FONT face=Arial size=2>class <-- root element is
class<BR>[[Element: <description/>]] <-- description is a child element
of class<BR><description>From Cello MIM. <BR> <BR>Ref.
[MOM_Cello]</description></FONT></SPAN></DIV></SPAN></FONT><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Mikael Petterson (KI/EAB)
[mailto:mikael.petterson@ericsson.com] <BR><B>Sent:</B> Friday, April 21, 2006
10:18 AM<BR><B>To:</B> Edelson, Justin;
jdom-interest@jdom.org<BR><B>Subject:</B> RE: [jdom-interest] Problem to read
xml with jdom when CR<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2>It seems like the parser interprets <description> as
a child on the same 'level' as <class> in the latter
case.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2>Helpful enough?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2>cheers,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=999391414-21042006><FONT face=Arial
color=#0000ff size=2>//mikael</FONT> </SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>Edelson,
Justin<BR><B>Sent:</B> den 21 april 2006 15:41<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> RE: [jdom-interest] Problem to read
xml with jdom when CR<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=136344013-21042006>Can you explain what you mean by "cannot
read"?</SPAN></FONT></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>Mikael Petterson
(KI/EAB)<BR><B>Sent:</B> Friday, April 21, 2006 7:56 AM<BR><B>To:</B>
jdom-interest@jdom.org<BR><B>Subject:</B> [jdom-interest] Problem to read xml
with jdom when CR<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/rtf format -->
<P><FONT face=Arial size=2>Hi,</FONT> </P>
<P><FONT face=Arial size=2>When we read one version of the xml we had the
following:</FONT> </P>
<P><FONT face=Arial size=2></FONT></P><BR>
<P><FONT face=Arial size=2><class name="Aal0TpVccTp"></FONT> <BR><FONT
face=Arial size=2>
<description>From Cello MIM. </FONT><BR><FONT face=Arial size=2>Ref.
[MOM_Cello]</description></FONT> <BR><FONT face=Arial
size=2>
<systemCreated/>
</FONT><BR><FONT face=Arial
size=2> <attribute
name="Aal0TpVccTpId">
</FONT><BR><FONT face=Arial
size=2>
<mandatory/>
</FONT><BR><FONT face=Arial
size=2>
<noNotification/>
</FONT><BR><FONT face=Arial
size=2>
<restricted/>
</FONT><BR><FONT face=Arial
size=2>
<dataType>
</FONT><BR><FONT face=Arial
size=2>
<string/>
</FONT><BR><FONT face=Arial
size=2>
</dataType>
</FONT><BR><FONT face=Arial
size=2>
</attribute> </FONT><BR><FONT face=Arial
size=2></class></FONT> </P><BR>
<P><FONT face=Arial size=2>In the new version of the xml we have the following
that jdom cannot read ( carriage return after MIM):</FONT> </P>
<P><FONT face=Arial size=2><class name="Aal0TpVccTp"></FONT> <BR><FONT
face=Arial size=2>
<description>From Cello MIM.</FONT> <BR><FONT face=Arial
size=2> </FONT> <BR><FONT face=Arial size=2>Ref.
[MOM_Cello]</description></FONT> <BR><FONT face=Arial
size=2>
<systemCreated/>
</FONT><BR><FONT face=Arial
size=2> <attribute
name="Aal0TpVccTpId">
</FONT><BR><FONT face=Arial
size=2>
<mandatory/>
</FONT><BR><FONT face=Arial
size=2>
<noNotification/>
</FONT><BR><FONT face=Arial
size=2>
<restricted/>
</FONT><BR><FONT face=Arial
size=2>
<dataType>
</FONT><BR><FONT face=Arial
size=2>
<string/>
</FONT><BR><FONT face=Arial
size=2>
</dataType>
</FONT><BR><FONT face=Arial
size=2>
</attribute> </FONT><BR><FONT face=Arial
size=2></class></FONT> </P><BR>
<P><FONT face=Arial size=2>Any ideas if this is a known problem ? Or if there is
a workaround for it?</FONT> </P>
<P><FONT face=Arial size=2>Cheers,</FONT> </P>
<P><FONT face=Arial size=2>//mikael</FONT> </P></BODY></HTML>