[XML-SIG] Divorcing SAX2 and DOM
Tue, 14 Mar 2000 10:26:43 -0800
When discussing SAX, a crucial priority in everyone's mind has been
performance, performance, performance. In most languages, creating
objects has a higher cost than passing information as parameters. So,
for instance, creating a "text node" is more expensive than passing the
string and offsets. SAX is good for high performance and small machines
(e.g. XML B2B EDI on WinCE HPCs).
In many cases parsers could support both the high level and low level
APIs directly and in others the high level API could be layered on top
of the low level one with a standard adapter.
In both Perl and Python there will be a particular parser that is
considered "standard" -- Expat. It makes sense to hook up EventDOM (or
whatever it is called) and Expat directly.
> The strongest argument against DOM in SAX is "heavyweight" DOM (in
> Java). Where's Java's equivalent of "mini-DOM" or a lightweight DOM?
I think the biggest cost is creating the DOM nodes and the "heaviness"
or "lightness" of the nodes is not as important.
Anyhow, this may interest you: http://xml.apache.org/xalan/dtm.html
Paul Prescod - ISOGEN Consulting Engineer speaking for himself
If all you want is sleep, go to bed.
But if you want to dream, go to Barbados.
- Timothy Findley, "Barbados: The Very Pineapple of Perfection"