[jdom-interest] Slower Transform using to use JDOMSource than DOMOutputter + DOMSource. Why??

s s ss_theone at hotmail.com
Tue Jul 30 05:42:08 PDT 2002


Hello,

I am using JDOM beta 8 (not latest from CVS), and there is no DocType 
information attached to the document. It's just a relatively large xml file.

Has anyone experienced this type of behaviour when transforming large 
documents?

Sean.

>From: Laurent Bihanic <laurent.bihanic at atosorigin.com>
>To: s s <ss_theone at hotmail.com>
>CC: jdom-interest at jdom.org
>Subject: Re: [jdom-interest] Slower Transform using to use JDOMSource than 
>DOMOutputter + DOMSource. Why??
>Date: Tue, 30 Jul 2002 10:11:20 +0200
>
>
>Hi,
>
>Which JDOM version are you using? If you are using the latest from CVS and 
>if your document has some DocType information attached, you could try to 
>prevent JDOM from reading and firing DTD events by disabling the SAX 
>validation feature on JDOMSource:
>    jds.getXMLReader().setFeature("http://xml.org/sax/features/validation", 
>false);
>
>Hope this helps,
>
>Laurent
>
>
>s s wrote:
>>Hello All,
>>
>>I am testing XSLT transformations using a JDOM Document. There are two 
>>tests I am comparing: (Assuming we have a JDOM Document named 'document'.
>>
>>1) Using org.jdom.transform.JDOMSource as recommended by JDOM people:
>>
>>JDOMSource jds = new JDOMSource(document);
>>StreamResult jres = new StreamResult(stringWriter);
>>transformer.transform(jds, jres);
>>
>>2) Using org.jdom.output.DOMOutputter and javax.xml.transformDOMSource:
>>
>>DOMOutputter domo = new DOMOutputter();
>>org.w3c.dom.Document documentW3C = domo.output(document);
>>DOMSource ds = new DOMSource(documentW3C);
>>StreamResult res = new StreamResult(stringWriter);
>>transformer.transform(ds, res);
>>
>>For a very large JDOM Document the following are the results I am getting:
>>
>>Test 1) average: 12 seconds (for entire transformation)
>>Test 2) average: 2 seconds (mostly for converting the document)
>>
>>Can anybody explain why the difference in results? I don't even understand 
>>the the 2 seconds result, when using the MS Parser+XSLT processer it takes 
>>less than 1 second.
>>
>>
>>Any help for speeding up my transformation would be very helpful. 
>>Otherwise I might have to change my application to use 
>>org.w3c.dom.Document all over which I don't want to since JDOM is much 
>>nicer to use.
>>
>>
>>Thanks!
>>--
>>Sean S.
>>ss_theone at hotmail.com




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com




More information about the jdom-interest mailing list