GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Programming  >  XML
Go To First  |  Previous Question  |  Next Question 
 XML  |  Question 3 of 40    Print  
What are the differences between SAX and DOM parsers?

  
Total Answers and Comments: 20 Last Update: May 06, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: K.Hari Kishore
 
Hi friends this is hari. SAX Parser is the one which is developed to run the java programs especially. It uses a memory resident model. DOM is developed by w3c consortium so that it is an open standard. In DOM the xml file is arranged as a tree and backward and forward search is possible for searching the tags and evaluating the data which it holds. It depends upon the application and ease of data accessiblity. If we want to extract the data from a xml file once we have to move to SAX, which is one time top to bottom read approach and if we want ot randomly pick the data in an xml file then the tree reperesentation of DOM model is to be put into use. Thats all !

Above answer was rated as good by the following members:
talktoatish
  Sorting Options  
  Page 1 of 2   « First    1    2    >     Last »  
June 16, 2005 17:33:20   #1  
K.Hari Kishore        

RE: What are the differences between SAX and DOM parsers?
Hi friends this is hari. SAX Parser is the one which is developed to run the java programs especially. It uses a memory resident model. DOM is developed by w3c consortium so that it is an open standard. In DOM the xml file is arranged as a tree and backward and forward search is possible for searching the tags and evaluating the data which it holds. It depends upon the application and ease of data accessiblity. If we want to extract the data from a xml file once we have to move to SAX which is one time top to bottom read approach and if we want ot randomly pick the data in an xml file then the tree reperesentation of DOM model is to be put into use. Thats all !
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
December 19, 2005 16:43:12   #2  
prasanna_b2001@yahoo.com Member Since: December 2005   Contribution: 8    

RE: What are the differences between SAX and DOM parse...

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.

Prasanna Balaraman.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
May 10, 2006 03:28:46   #3  
Sathish Kola        

RE: What are the differences between SAX and DOM parse...

Hi

I felt very happy by seaing this comparsions and differences od SAX and DOM

Thanks

Sathish Kola


 
Is this answer useful? Yes | No
August 06, 2006 12:18:54   #4  
Srinivas A        

RE: What are the differences between SAX and DOM parse...

Thanks All

Differences are prettey clear.

--Srinivas A


 
Is this answer useful? Yes | No
August 10, 2006 07:45:55   #5  
Subhash Thakur        

RE: What are the differences between SAX and DOM parse...
Hi Prassanna Thanks for simple and clear differentiations.regards Subhash Thakur
 
Is this answer useful? Yes | No
August 15, 2006 17:36:48   #6  
Kalyan        

RE: What are the differences between SAX and DOM parse...
Thanks Prasanna !! Your explanation was so clear.
 
Is this answer useful? Yes | No
September 01, 2006 03:09:22   #7  
avinash verma        

RE: What are the differences between SAX and DOM parse...

Hi thanks for share your knowledge on SAX and Dom parse . Please send me more article relataed to these parser. I am very thankful to you.

thanks and regards

AvinashV.


 
Is this answer useful? Yes | No
September 15, 2006 08:23:32   #8  
Guru Brahmam        

RE: What are the differences between SAX and DOM parse...

Hi

Thanks Prasanna those are simple and precise differences.

Guru Brahmam


 
Is this answer useful? Yes | No
October 12, 2006 12:20:00   #9  
sridhar        

RE: What are the differences between SAX and DOM parse...

hai prasanna i am fully satisfied with u r clear differences.

very very very...... thanks to u.


 
Is this answer useful? Yes | No
October 18, 2006 02:03:05   #10  
Mathan        

RE: What are the differences between SAX and DOM parse...

Hi Prasana..

The differences ae so clear....One small amendment Like DOM SAX parser will also allow us to add/update new XML elements.

3. We cant insert or delete a node


 
Is this answer useful? Yes | No
  Page 1 of 2   « First    1    2    >     Last »  


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape