what is the difference between SAX Parser and DOM Parser??

Answer Posted / guest

1. sax is an event based parser and raise and event, while
dom is not
2. sax is forward only where as dom can acess both was
forward as well as backwards.
3. sax parses the file as it reads where as the dom loads
the file into memory to parse the file.
4. Sax does not have memory constraints where as the dom
has momory constraints as xml file is loaded into the
momory to parse the file.
5. sax is read only , dom is read and write both.
6. if you have to parse and use the content only once ,
consider using sax if the xml file and content are used
extensively then consider using dom

Is This Answer Correct ?    187 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use struts and spring together?

531


Can we handle exceptions in Struts programmatically?

517


Does Struts2 action and interceptors are thread safe?

605


What is the purpose of @requiredstringvalidator annotation?

529


How can link tag’s action attribute be used?

522






What’s the utilization of struts.xml configuration file?

537


When should be opt for struts framework?

575


What is the purpose of execute() method?

569


How do I install struts?

562


What is front controller in struts2?

552


What are the various struts tag libraries?

548


Which design pattern the interceptors in struts2 is based on?

492


What is Custom Type Converter in Struts2?

627


How to upload struts file?

602


Briefly tell the two kinds of form beans.

559