When do we use a DOM parser and when do we use a SAX parser?

DOM: Document Object Modal
SAX: Simple API for XML

The answer to above question is,

the DOM Approach is useful for small documents in which the program needs to process a large portion of the document whereas the SAX approach is useful for large documents in which the program only needs to process a small portion of the document.

Advertisements

#dom, #sax