What are the differences between sax and dom parsers?
Answered by: firstname.lastname@example.org
View all answers by email@example.com
Member Since Dec-2005 |
Answered On : Dec 19th, 2005
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.
The SAX parser we can parse it by tag by tag, SAX Parser will not store in MemoryWhere as in DOM parser the Document will be read fully and store it in Memory and Start Parsing.
The main difference between DOM and SAX is in the representation of the XML document they use. DOM uses an in-memory tree-like structure, whereas, SAX uses linear event driven approach.
How productive are you?
Has there been a time when you were presented a problem and solved it?
What are the things you wish to achieve in 5 years?
What are the career options available in Software Testing Industry?
Describe a time when you had to listen to someone.
What was the most important decision you ever had to make?
Aptitude Test Preparation Tips
BPO Career for BTech Graduates
Give me good reasons why should I choose you over others.
Career Options for BCA Graduates
Ask Interview Question?
Have Career Question?
Ask Only Career questions.