AW: sax or dom in XSLT procesing ? 2003-01-28 - By Stefan.Kaesberg@(protected)
Hello Andrey,
i've asked me the same question some weeks ago. I made some measurements and found that using i.e. SAX-source on DOM-objects works but is not really useful. So I took DOMSource for Input. Inside xalan (i think) it's doing the following:
Source -> DTM -> Transformation to DTM' -> Result.
Since it has to convert the source into the document table model (DTM) maybe that's the effect you observe.
If you have several subsequent transformations chaining/piping lets you work dirctly on DTMs. (use Filters)
On the other hand i took Streams (javax.xml.transform.stream.StreamSource / StreamResult) for in- and output and placed my data in large byte-Arrays. That was the fastest way i could transform (with xalan).
Unfortunately in my architecture "Transformers" are either XSL Processors or other classes that transform my DOM and i always got DOMs and have to produce DOMs. Therefore Chaining/Piping is no solution for me, but maybe you should consider. If performance is what you want, take xsltc unless you have to do with Xalan extensions not supported in xsltc. After all i think SAX is only useful if you have a SAX-Parser that fires SAX Events. Hope that helps, Stefan
-----Urspr�ngliche Nachricht----- Von: Andrey Solonchuk [mailto:solo@(protected)] Gesendet: Di 28.01.2003 00:05 An: xalan-j-users@(protected) Cc: Betreff: sax or dom in XSLT procesing ?
Hello xalan-j-users, when I see how to use xalan for xslt I founded that as source it can use both DOM and SAX. I make data for procesing with xslt in my programm and withot saveng xml data to disk transform it with xstl. What is better to use as input data? dom or sax? I think that xslt processor in any case convert inpur data to DOM and only after that transform. whats you opinion ? if i`m right ? -- Best regards, Andrey mailto:solo@(protected)
|
|