Home Depot Interview Question
Software Engineer / Developers1. a. DOM stands for Document Object Model.
b. SAX stands for Simple API for XML.
2. a. DOM reads entire XML file at once.
b. SAX reads XML file line by line.
3. a. DOM is memory consuming.
b. SAX is not.
4 a. DOM follows hierarchical model
b. SAX follows event based model while reading XML.
5 a. Using DOM we can add,remove update the XML elements
b. SAX is read only.
and etc
I know these only
Thanks
SAX can be used only for a sequential processing of an XML document whereas DOM can be used for a random processing of XML docs.
- sumanthbadethalavr October 04, 2012SAX uses call back mechanism and uses event-streams to read chunks of XML data into the memory in a sequential manner. DOM uses a tree representation of the underlying XML document and facilitates random access/manipulation of the underlying XML data.
SAX can be used only for reading XML documents and not for the manipulation of the underlying XML data whereas DOM can be used for both read and write of the data in an XML document.