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

Answer Posted / penchala

Both SAX and DOM are used to parse the XML document. Both
has advantages and disadvantages and can be used in our
programming depending on the situation
SAX:
1. Parses node by node
2. Doesnt store the XML in memory
3. We cant insert or delete a node
4. Top to bottom traversing
DOM
1. Stores the entire XML document into memory before processing
2. Occupies more memory
3. We can insert or delete nodes
4. Traverse in any direction.
If we need to find a node and doesnt need to insert or
delete we can go with SAX itself otherwise DOM provided we
have more memory.

Is This Answer Correct ?    197 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of @beforeresult annotation?

758


How to combine the struts with velocity template?

678


When do I need “struts.jar” on my classpath?

737


What is the purpose of @requiredstringvalidator annotation?

695


How to convert struts to spring mvc?

730


What are the benefits of Struts framework?

724


What is the purpose of @key annotation annotation?

812


How is a lookup dispatch action created?

759


Who makes the struts?

713


What configuration changes are required to use resource files in Struts?

773


What are the reasons for an error message not being displayed while developing struts application?

724


What are action errors and error and what are the consequences they impose?

773


How the flow of various requests happens in struts application?

740


What is role of actionservlet?

754


How to work with error tags?

747