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

How to handle exceptions in structs?

564


What is the difference between empty default namespace and root namespace?

546


How to get data from the velocity page in a action class?

561


Is Struts Framework part of J2EE?

607


Does apache struts run on windows?

528






What are the applications of struts?

525


What’s the difference between struts and espresso?

498


Which interceptor is responsible for mapping request parameters to action class Java Bean properties?

556


Is struts action class singleton?

544


How does struts2 token work?

521


How is the action mapping specified?

540


What is the purpose of action tag in struts.xml?

554


What's the purpose of execute method of action class?

525


What is interceptor in Struts2?

561


What is the purpose of @conversion?

597