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

Answer Posted / raju

SAX
• Parses node by node
• Doesn’t store the XML in memory
• We cant insert or delete a node
• SAX is an event based parser
• SAX is a Simple API for XML
• doesn’t preserve comments
• SAX generally runs a little faster than DOM

DOM
• Stores the entire XML document into memory before processing
• Occupies more memory
• We can insert or delete nodes
• Traverse in any direction.
• DOM is a tree model parser
• Document Object Model (DOM) API
• Preserves comments
• SAX generally runs a little faster than DOM

-raju

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the life cycle methods of interceptor?

522


What is the use of form bean in struts?

512


How to convert struts to spring mvc?

539


What is the purpose of form-beans tag in struct-config.xml?

553


Which configuration files are used in struts?

528






Which design pattern is implemented by Struts2 interceptors?

556


What does the term struts mean?

561


What is the purpose of @element?

584


Is struts compatible with other java technologies?

533


What is apache struts framework?

524


What is actioncontext?

553


What is actioninvocation?

544


Explain the difference between dispatchaction and lookupdispatchaction in struts?

2118


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

561


How many Action classes have been used in your project? Differences between struts 1.1 and 1.3?

2536