:: 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 (1721)
 Advanced Java interview questions  Advanced Java Interview Questions (331)
 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 (146)
 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
What is Struts Flow? CTS 17
why we are using vo,dao and dto design patterns in struts framework Wipro 2
what are java stuts? what are there uses Tech-Mahindra 2
explain the struts-configuration file? TCS 3
we have 7 jsp pages .At last page we have a submit button when we click it it will store all jsps data which we provide will store into database. when we starting providing data in jsp pages when we are at 3rd jsp at that time sessions timeout where the data will be store which we r provide in last two jsps?   2
can anybody tell.what is the difference between Forward Action and Action Forward? TCS 2
if u r using eclipse tool how can u debbaging u r application? plz explain with sample code Tech-Mahindra 3
what are the componenets of struts? HCL 8
How many types of action clases are there in stuts and their uses? TCS 14
Can we write our own ActionServlet for front controller of Struts Applications? NIIT 2
How to forward from Array List to Jsp in Struts ActionServlet class?   8
Struts follows which design patterns? IGT 4
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.   ::