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

How can link tag’s action attribute be used?

522


What is struts? Explain

540


How do struts work?

520


What is java struts?

538


How many instances of servlet usually run in a struts application ?

542






What is switchaction?

655


What does apache struts do?

504


Are struts and shocks the same?

502


What is the purpose of @before?

550


What is token used for?

511


What are the applications of struts?

533


What do you mean by the abstract package in struts2, and what is its utilization?

513


Describe validate() and reset() methods.

602


What do you mean by actionmapping?

532


When it’s useful to use IncludeAction?

548