Why DOM Parser would take more Memory than SAX parser
while they are parsing?

Answer Posted / sandya

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 ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name three subclasses of the component class?

614


What is the purpose of the notify() method?

596


What are the oops concept?

575


Whats new with the stop(), suspend() and resume() methods in jdk 1.2?

581


What is the difference between the font and fontmetrics classes?

560






how to use debug in my elipse to solve problems that exist in my project

1762


What is in-memory replication?

557


Difference between new operator and class.forname().newinstance()?

598


What is metaspace?

548


What class is used to create Server side object ?

1668


Which are the different segments of memory?

593


Is infobus easy to use?

598


What is prototype?

607


In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?

1556


Explain the different types of memory used by jvm?

612