Use SAX when:
You need to scan large XML documents including: Scan huge files with little overhead.
You need more control over the parsing process: SAX does not actually do much only your program decides how anything is used, if at all.
You have limited system resources: SAX does not create many objects.
You need high performance: SAX quickly locates elements within any size XML document.
Use DOM when:
You need to make multiple processing passes over an XML document and no need to rescan the document on each pass
You need to merge several XML documents together. Here the structures can be the same or different
You need to do a lot with document content including: Sharing content with other processes, Frequent access of content
You need to modify document…including Content or Structure or Order
subject: learning about SAX Parser and the DOM Parsers