[jdom-interest] JDOM taking too much time to convert xml string to Document object
Chabbewal, Navjeet
navjeet.chabbewal at us.didata.com
Mon May 13 06:26:42 PDT 2002
Yes, indeed it is the default parser used by JDOM (I believe crimson in
this case). Once I plugged in orcacle's xml parser, things were back to
normal.
--Navjeet
> -----Original Message-----
> From: Alex Rosen [mailto:arosen at silverstream.com]
> Sent: Sunday, May 12, 2002 4:38 PM
> To: 'Chabbewal, Navjeet'; jdom-interest at jdom.org
> Subject: RE: [jdom-interest] JDOM taking too much time to convert xml
> string to Document object
>
>
> - It's unlikely that JDOM is causing the slowdown. JDOM is
> not a parser, it's using Xerces to do the XML parsing. JDOM
> is just building a tree from the results that Xerces passes
> in. You might try just using Xerces to parse the file into a
> DOM tree and see if you see the same behavior.
>
> - Not knowing anything about your DTD or XML, the first thing
> that comes to my mind when such a dramatic slowdown occurs is
> that maybe it's now retrieving some data from another
> machine. E.g. if something in your DTD is now referencing an
> entity on a remote server, or something along those lines
>
> Alex
>
> > -----Original Message-----
> > From: jdom-interest-admin at jdom.org
> > [mailto:jdom-interest-admin at jdom.org]On Behalf Of Chabbewal, Navjeet
> > Sent: Tuesday, May 07, 2002 4:04 PM
> > To: jdom-interest at jdom.org
> > Subject: [jdom-interest] JDOM taking too much time to convert
> > xml string
> > to Document object
> >
> >
> > I have been using JDON ony my project for a while but
> > recently we had a
> > modification in a dtd which seens to cause an substantial
> increase in
> > the time taken to convert an xml string into Document object.
> > The change
> > was that one of the elements which had 22 sub-elements now has 39
> > sub-elements. Now this is the weird behaviour I am seeing.
> > When the xml
> > string does not have one particular xml element ( one of the 39
> > sub-elements) it takes 4-5 times more time to process the
> > xml. All these
> > sub-elements are optional. I have been using JDOM-B7 but I
> downloaded
> > JDOM-B8 with the same results. Here is the code to convert
> the xml to
> > Document object:
> >
> > public Document buildDocument(String xml) throws
> > XMLConversionException
> > {
> > Timer methodTimer = new Timer("buildDocument(xml)");
> > methodTimer.start();
> > Document document = null;
> > SAXBuilder saxBuilder = new SAXBuilder(true);
> > try {
> > document =
> > saxBuilder.build(new InputSource(new
> > StringReader(xml)));
> > } catch (JDOMException e) {
> > log.error("build document failed", e);
> > throw new XMLConversionException(e.toString());
> > }
> > methodTimer.stop();
> > log.info( methodTimer.toString() );
> > return document;
> > }
> >
> > I have xerces and xalan jar files which come with JDOM in
> my classpath
> > before jdom jar file.
> >
> > Any ideas what could be happening !!!!
> >
> >
> > --Navjeet
> >
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-interest/yo
> uraddr at yourhost.com
>
More information about the jdom-interest
mailing list