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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / guest

DOM Parser loads the entire xml data model into the memory
where as sax dont.


Is This Answer Correct ?    6 Yes 1 No

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

Answer / paven

Dom parser has to read all the thinges in xml so it takes
more memory and time where as sax parser takes data of our
wish so less time and memory

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Advanced Java Interview Questions

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?

0 Answers  


the same information whether it will connect to the database or it will be used previous information?

0 Answers  


What is the difference between RMI and Socket?

2 Answers  


Which Taglibraury you used in your project? plz send me ans....which we r using generally

2 Answers  


Explain Object Serialization and it can be used?

3 Answers   Infosys,






How can I avoid validating a form before data is entered?

0 Answers  


How to do registration form using struts and hibernate?

1 Answers  


How do you set security in applets?

1 Answers   IBM,


how to search the pertical objects in a Collections

3 Answers   iGate,


types of exceptions

1 Answers  


What is a clone?

0 Answers  


Write a program on RMI and JDBC using StoredProcedure?

1 Answers  


Categories