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

the use of try and ffinally keyword

1 Answers  


How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!

0 Answers  


Are there books about seam?

0 Answers  


What are the different methods of identifying an object?

0 Answers  


How do you maintain a stateful session object across the session

2 Answers   HCL,






Explain how will the struts know which action class to call when you submit a form?

0 Answers  


Describe, in general, how java's garbage collector works?

0 Answers  


Can you give me a simple example of using the requiredif validator rule?

0 Answers  


How many times may an objects finalize() method be invoked by the garbage collector?

0 Answers  


hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me

0 Answers   Infosys,


Explain ioc concept?

0 Answers  


How can I scroll through list of pages like the search results in google?

0 Answers  


Categories