[jdom-interest] Problem to read xml with jdom when CR
Edelson, Justin
Justin.Edelson at mtvn.com
Mon Apr 24 08:13:29 PDT 2006
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:
public static void main(String[] args) throws JDOMException {
SAXBuilder builder = new SAXBuilder(); // or however you are creating a
SAXBuilder
XMLReader reader = builder.createParser();
System.out.println(reader.getClass().getName());
}
However, this won't tell you why JDOM is using that parser or from which
jar in your classpath the parser class is being loaded from.
________________________________
From: jdom-interest-bounces at jdom.org
[mailto:jdom-interest-bounces at jdom.org] On Behalf Of Mikael Petterson
(KI/EAB)
Sent: Monday, April 24, 2006 4:06 AM
To: Mattias Jiderhamn; jdom-interest at jdom.org
Subject: RE: [jdom-interest] Problem to read xml with jdom when CR
Hi,
I read at www.cafeconleche.org (Elliot Rusty's site) the following:
JDOM does not itself include a parser. Instead it depends on a SAX
parser with a custom ContentHandler to parse documents and build JDOM
models from them. Xerces 1.4.4 is bundled with JDOM.
I am using the following in the code:
SAXBuilder builder = new SAXBuilder();
try {
File xmlFile = new File(aFileName);
xmlDoc = builder.build(xmlFile);
} catch (Exception e) {
}
In the APi for JDOM 1.0 I read the following:
public SAXBuilder()
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.
Is there a way to find the underlying sax parser used?
cheers,
//mikael
________________________________
From: Mattias Jiderhamn [mailto:mj-lists at expertsystems.se]
Sent: den 21 april 2006 17:46
To: Mikael Petterson (KI/EAB); jdom-interest at jdom.org
Subject: Re: [jdom-interest] Problem to read xml with jdom when CR
Please note that the SAXBuilder uses the underlying W3C SAX parser.
Probably the problem lies there.
What SAX parser are you using? Have you tried another SAX parser?
At 2006-04-21 13:56, Mikael Petterson \(KI/EAB\) wrote:
Content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C6653A.9D811623"
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060424/fb02b059/attachment.htm
More information about the jdom-interest
mailing list