Analyst Integration Question:

What is difference between DOM and SAX parser?

Tweet Share WhatsApp

Answer:

DOM parser is a in memory parser so it loads whole XML file in memory and create a DOM tree to parse. SAX parser is a event based parser, so it parses XML document based upon event received e.g. opening tag, closing tag, start of attribute or end of attribute. Because of their working methodology, DOM parser is not suitable for large XML file as they will take lot of space in memory and your process may ran out of memory, SAX is the one which should be used to parse large files. For small files, DOM is usually much faster than SAX.

Download Integration Programmer PDF Read All 87 Integration Programmer Questions
Previous QuestionNext Question
What is heap and stack in a process?What is a critical section?