DOM & SAX parsers explanation and difference ?

Answer Posted / sangeri

DOM parser

1.In DOM parser the representation is in the memory as it
is used for the internal representation of an
XML document.
2.It reads the whole document and returns a DOM tree
representation of the
XML document.
3.So for smaller xml we can use DOM as memory is the
constraint.

SAX parser

1.It is event driven
2.It works incrementally and generates events that are
passed to the application.
3.For huge
XML we can go for SAX rather than DOM
4.It does not give any structural representation for the
XML document.

So depending on the application you develop you can choose
any of the parser

Is This Answer Correct ?    31 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the standard ways of parsing xml document?

475


What are the advantages of xml over html?

427


What is the use of xslt?

466


What is the use of xslt element?

434


Do you feel that you are a good xslt programmer? : xslt

436






State some advantages of xml?

551


How do applications process documents that use xml namespaces?

464


Does the xml namespaces recommendation define anything except a two-part naming system for element types and attributes?

482


How was xml created?

466


How do I publish an xml message?

519


Can we generate xsd from xml?

469


Is html xml?

460


Where do I find my rss feed url on wordpress?

461


Why xsl is used in xml?

486


Is xml a flat file?

477