Link to home
Start Free TrialLog in
Avatar of callapm
callapm

asked on

SAX vs. DOM

Can anyone discuss, in detail, the advantages or disadvantages of using SAX to parse an XML file rather than DOM?  Are there any particular qualities that a file containing XML should have which would make it more suitable for one or the other???
Avatar of deanejoyce
deanejoyce

Basically sax is a serial API and dom needs the whole document model in order to process stuff.....

if you have a large database or distributed datbases containing lots of info, use sax.....it's way quicker.....

if your documents or database are relatively small use dom....

so in a b2b situation I nearly always go for sax unless you are dealing with a small vendor....

I hear the new apache/perl validating parser is pretty good for DOM, so perhaps you should check it out.....

deane

Hi callapm,

That's a long discussion, for more perspective

http://www.xml.com/pub/Guide/SAX_vs._DOM

or for SAX
http://www.xml.com/pub/Guide/SAX
or DOM
http://www.xml.com/pub/Guide/DOM

HTH:O)Bruintje
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial