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

s s ss_theone at hotmail.com
Thu Jul 25 11:37:15 PDT 2002


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



_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx




More information about the jdom-interest mailing list