ALLInterview.com :: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Google
   
 
Categories >> Software >> Java Related >> Java J2EE >> Struts
 
 


 

 
 Core Java interview questions  Core Java Interview Questions (1720)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 Swing interview questions  Swing Interview Questions (43)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (195)
 JDBC interview questions  JDBC Interview Questions (187)
 JMS interview questions  JMS Interview Questions (9)
 SunOne interview questions  SunOne Interview Questions (3)
 J2EE interview questions  J2EE Interview Questions (71)
 Weblogic interview questions  Weblogic Interview Questions (145)
 Websphere interview questions  Websphere Interview Questions (14)
 Java Networking interview questions  Java Networking Interview Questions (20)
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions (87)
Question
what is the difference between SAX Parser and DOM Parser??
 Question Submitted By :: Sandya
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 1
1. sax is an event based parser and raise and event, while
dom is not
2. sax is forward only where as dom can acess both was
forward as well as backwards.
3. sax parses the file as it reads where as the dom loads
the file into memory to parse the file.
4. Sax does not have memory constraints where as the dom
has momory constraints as xml file is loaded into the
momory to parse the file.
5. sax is read only , dom is read and write both.
6. if you have to parse and use the content only once ,
consider using sax if the xml file and content are used
extensively then consider using dom
 
Is This Answer Correct ?    185 Yes 12 No
Guest
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 2
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 ?    188 Yes 11 No
Penchala
 
 
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 3
hii Penchala..

U r Explination is pretty good..
 
Is This Answer Correct ?    47 Yes 14 No
Chaithanya
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 4
Cant we insert or delete a node in SAX???? 
Is This Answer Correct ?    48 Yes 35 No
Simi
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 5
very nice explaination 
Is This Answer Correct ?    27 Yes 12 No
Venkateswarlu
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 6
It really nice Explanation by penchala the more about XML

SAX :
---
SAX Parser is the one which is developed to run the java
programs especially.

DOM:
---
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 Correct ?    35 Yes 7 No
Shyam Miyatra
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 7
very good explanation

Thank you.
 
Is This Answer Correct ?    13 Yes 5 No
Madhu
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 8
Thank you..it helped us a lot :) 
Is This Answer Correct ?    10 Yes 5 No
Natasha,ashwni,smita,prajakta
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 9
sax is simple api for xml
it read the first xml data and get outputed backward is not
possible,
dom is doccument object model
through dom we can create a xml data as a tree and it is
loaded in memory so we can easily access the data
 
Is This Answer Correct ?    7 Yes 4 No
Chaitheesh
 
  Re: what is the difference between SAX Parser and DOM Parser??
Answer
# 10
DOM
1. Tree of nodes
2. Memory: Occupies more memory, preffered for small XML
documents
3. Slower at runtime
4. Stored as objects
5. Programmatically easy
6. Ease of navigation
SAX
1. Sequence of events
2. Doesn't use any memory preferred for large documents
3. Faster at runtime
4. Objects are to be created
5. Need to write code for creating objects
6. Backward navigation is not possible as it sequentially
processes the document
 
Is This Answer Correct ?    17 Yes 5 No
Ashish
 

 
 
 
Other Struts Interview Questions
 
  Question Asked @ Answers
 
how to write my own Action servlet by extending pre-defined Action servlet in struts config. Sony 2
Can we have different controllers in one struts app? Accenture 7
why do we use logic tag library in struts? Polaris 1
Difference between JSF Framework and Struts Framework. Accenture 13
is it necessary to write struts-confing.xml ,what tags are important in that xml file?   2
If we close the browser,when the specific user session is active.Again if we open browse how to retrive it same user??what code i have to da??? TCS 5
what are the componenets of struts? HCL 8
explain method overridding method overloding with examples? IBM 5
wat happen when the connection is nt closed in jdbc n what vl happen when i interchange in executequery n execute statements   2
what are the actions in struts? Wipro 10
how to write the configuration file of struts application if any one had simple struts application please it to me   1
what is frame work in struts? Infosys 3
 
For more Struts Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com