Re: Is DOM more efficient than SAX for smaller xml instances?

From
Frans Englich <>
To
Date
2006-08-24T14:07:51Z
ID
<>
Thread
Re: Is DOM more efficient than SAX for smaller xml instances?
On Thursday 24 August 2006 13:41, bryan rasmussen wrote:
> I seem to remember once, long ago, reading something showing DOM was
> more efficient than SAX for small XML instances - small being approx
> 40 kb.

It depends on what you do with it, if you ask me.

DOM does essentially what would SAX do(parse XML into events) but from there 
continues to build a tree, typically. Obviously, this is less efficient than 
only sending events.

So it all depends on what you do. If you take SAX events and builds a custom 
structure that consumes more memory and/or is slower to navigate than a DOM 
tree, it would be less efficient than using DOM..


Cheers,

		Frans