<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<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=577590315-24042006>If you created a class and put it in the org.jdom.input
package (because SAXBuilder.createParser() is protected), you could do something
like this:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=577590315-24042006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=577590315-24042006>public static void main(String[] args) throws
JDOMException {<BR> SAXBuilder builder = new SAXBuilder(); // or however
you are creating a SAXBuilder<BR> XMLReader reader =
builder.createParser();<BR> System.out.println(reader.getClass().getName());<BR>}</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=577590315-24042006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=577590315-24042006>However, this won't tell you <EM>why</EM></FONT><FONT
face=Arial><FONT size=2><FONT color=#0000ff> JDOM is using that parser or from
which jar in your classpath the parser class is being loaded
from.</FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=577590315-24042006><FONT face=Arial><FONT
size=2><FONT color=#0000ff></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=577590315-24042006><FONT face=Arial><FONT
size=2><FONT color=#0000ff></SPAN> </DIV></FONT></FONT></FONT>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=577590315-24042006></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> Monday, April 24, 2006 4:06 AM<BR><B>To:</B> Mattias
Jiderhamn; 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=629264407-24042006><FONT face=Arial
color=#0000ff size=2>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2>I read at <A
href="http://www.cafeconleche.org">www.cafeconleche.org</A></FONT></SPAN><SPAN
class=629264407-24042006><FONT face=Arial color=#0000ff
size=2> (Elliot Rusty's site) the following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006>JDOM does not itself
include a parser. Instead it depends on a SAX parser with a custom
<TT>ContentHandler</TT> to parse documents and build JDOM models from them.
Xerces 1.4.4 is bundled with JDOM.</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2>I am using the following in the code:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2>SAXBuilder builder = new SAXBuilder();<BR> try
{<BR> File xmlFile = new
File(aFileName);<BR> xmlDoc =
builder.build(xmlFile);<BR> } catch (Exception e)
{</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2> }</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2>In the APi for JDOM 1.0 I read the
following:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=629264407-24042006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><SPAN class=629264407-24042006>
<DIV dir=ltr align=left><PRE>public <B>SAXBuilder</B>()</PRE></DIV>
<DIV dir=ltr align=left>
<DL>
<DD>Creates a new SAXBuilder which will attempt to first locate a parser via
JAXP, then will try to use a set of default SAX Drivers. The underlying parser
will not validate.</DD></DL></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=629264407-24042006><FONT face=Arial color=#0000ff size=2>Is
there a way to find the underlying sax parser used?</FONT></SPAN></DIV>
<DIV><SPAN class=629264407-24042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=629264407-24042006><FONT face=Arial color=#0000ff
size=2>cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=629264407-24042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=629264407-24042006><FONT face=Arial color=#0000ff
size=2>//mikael</FONT></SPAN></DIV></SPAN></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Mattias Jiderhamn
[mailto:mj-lists@expertsystems.se] <BR><B>Sent:</B> den 21 april 2006
17:46<BR><B>To:</B> Mikael Petterson (KI/EAB);
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>Please note that the SAXBuilder uses the underlying W3C SAX parser.
Probably the problem lies there.<BR>What SAX parser are you using? Have you
tried another SAX parser?<BR><BR>At 2006-04-21 13:56, Mikael Petterson
\(KI/EAB\) wrote:<BR>
<BLOCKQUOTE class=cite cite="" type="cite">Content-class:
urn:content-classes:message<BR>Content-Type:
multipart/alternative;<BR><X-TAB> </X-TAB>
boundary="----_=_NextPart_001_01C6653A.9D811623"<BR><BR><FONT
size=2>Hi,</FONT> <BR><BR><FONT size=2>When we read one version of the xml we
had the following:</FONT> <BR><BR><FONT size=2> </FONT> <BR><BR><FONT
size=2><class name="Aal0TpVccTp"></FONT> <BR><FONT
size=2>
<description>From Cello MIM. </FONT><BR><FONT size=2>Ref.
[MOM_Cello]</description></FONT> <BR><FONT
size=2>
<systemCreated/>
</FONT><BR><FONT size=2>
<attribute
name="Aal0TpVccTpId">
</FONT><BR><FONT
size=2>
<mandatory/>
</FONT><BR><FONT
size=2>
<noNotification/>
</FONT><BR><FONT
size=2>
<restricted/>
</FONT><BR><FONT
size=2>
<dataType>
</FONT><BR><FONT
size=2>
<string/>
</FONT><BR><FONT
size=2>
</dataType>
</FONT><BR><FONT size=2>
</attribute> </FONT><BR><FONT
size=2></class></FONT> <BR><BR><FONT size=2>In the new version of the
xml we have the following that jdom cannot read ( carriage return after
MIM):</FONT> <BR><BR><FONT size=2><class name="Aal0TpVccTp"></FONT>
<BR><FONT size=2>
<description>From Cello MIM.</FONT> <BR><FONT size=2> </FONT>
<BR><FONT size=2>Ref. [MOM_Cello]</description></FONT> <BR><FONT
size=2>
<systemCreated/>
</FONT><BR><FONT size=2>
<attribute
name="Aal0TpVccTpId">
</FONT><BR><FONT
size=2>
<mandatory/>
</FONT><BR><FONT
size=2>
<noNotification/>
</FONT><BR><FONT
size=2>
<restricted/>
</FONT><BR><FONT
size=2>
<dataType>
</FONT><BR><FONT
size=2>
<string/>
</FONT><BR><FONT
size=2>
</dataType>
</FONT><BR><FONT size=2>
</attribute> </FONT><BR><FONT
size=2></class></FONT> <BR><BR><FONT size=2>Any ideas if this is a known
problem ? Or if there is a workaround for it?</FONT> </BLOCKQUOTE></BODY></HTML>