What is the difference between SAX and DOM?

This question is related to Oracle Interview

Showing Answers 1 - 3 of 3 Answers

v.kalyani

  • Aug 31st, 2007
 

SAX stands for Simple API for XML. It is a standard interface for event based XML parsing. Programmers provide handlers to deal with different events as the document is passed. If we use SAX API to pass XML documents have full of control over what happens when the event occur as result, customizing the parsing process extensively. For example a programmer might decide to stop an XML document as as soon as the parser encounters an error that indicate that the document is invalid rather than waiting until the document is parsed. Thus improve the performance.DOM stands for Document Object Model. DOM reads an xml document into memory and represents as it as tree. Each node of tree represents a particular piece of data from the original document. The main drawback is that the entire xml document has to be read into memory for DOM to create the tree which might decrease the performance of an application as the xml document get larger.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions