Sherzod Ruzmetov wrote:
:Of course SAX, don't waste memory for superfluous temporary DOM.
I don't think it was a fair answer. Both tokenizing and tree processing have
their pros and cons. Advantages of SAX are:
The question was not about general events vs trees, but specifically, what's
the most effective approach for feeding an xslt processor - emitting SAX
events or building DOM object. Correct me if I'm wrong.
Disadvantages of SAX are:
* Easily forgets previous elements it worked on
* Not easy to re-order elements
* Cannot validate an XML document
* Canot easily verify ID-REF links
I'd like to discuss it, but it seems to be sort of offtopic here.
In fact, SAX-like processors are used to produce DOM-like processors.
That's why I have recommended SAX as input for xslt. If almost every xslt
processor always builds internal tree from its input, I don't see any
advantage of building possible huge DOM object just to move data.
--
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list