:: 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                      
Categories >> Software >> Java Related >> Java J2EE >> Struts


 Core Java interview questions  Core Java Interview Questions (1728)
 Advanced Java interview questions  Advanced Java Interview Questions (332)
 Swing interview questions  Swing Interview Questions (44)
 EJB interview questions  EJB Interview Questions (134)
 Servlets interview questions  Servlets Interview Questions (255)
 Struts interview questions  Struts Interview Questions (196)
 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 (147)
 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)
what is the difference between SAX Parser and DOM Parser??
 Question Submitted By :: Struts
I also faced this Question!!     Answer Posted By  
# 1
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
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
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 ?    189 Yes 11 No
# 2
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
# 3
hii Penchala..

U r Explination is pretty good..
Is This Answer Correct ?    47 Yes 14 No
# 4
It really nice Explanation by penchala the more about XML

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

DOM is developed by w3c consortium so that it is an open
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
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
# 5
very nice explaination 
Is This Answer Correct ?    27 Yes 12 No
# 6
Cant we insert or delete a node in SAX???? 
Is This Answer Correct ?    48 Yes 35 No
# 7
1. Tree of nodes
2. Memory: Occupies more memory, preffered for small XML
3. Slower at runtime
4. Stored as objects
5. Programmatically easy
6. Ease of navigation
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
# 8
very good explanation

Thank you.
Is This Answer Correct ?    13 Yes 5 No
# 9
Thank helped us a lot :) 
Is This Answer Correct ?    10 Yes 5 No
# 10
sax is simple api for xml
it read the first xml data and get outputed backward is not
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

Other Struts Interview Questions
  Question Asked @ Answers
why do we typecast ActionForm into out plain java bean class in Action class?   5
How to add ms-word file in struts at the same time how to add images   1
what are componeents presents in Strutsconfig.xml? HCL 2
What happens when Two users requests for same action class? How the threads are controlled?   4
if u r using eclipse tool how can u debbaging u r application? plz explain with sample code Tech-Mahindra 3
What is Hibernate?   4
what are tiles in struts? Wipro 3
Why should we go for struts framework? Accenture 5
how handle when client send multiple request at atime for single servlet IBM 5
how handle when client send multiple request at atime for multiple servlets servlets? IBM 3
i have list of values(e.g 100). using logic:iterate, how can i print the multiples of 5th element? how the logic:iterate will understand the multiples of 5. CTS 2
why do we use logic tag library in struts? Polaris 1
For more Struts Interview Questions Click Here 

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