The main advantages of the SAX parser over the DOM include:
It can parse documents of any size.
Useful when you want to build your own data structures.
Useful when you want only a small subset of information contained in the XML document.
It is simple.
It is fast.
Its main disadvantages include:
It does not provide random access to the document; it starts at the beginning and reads through serially to the end.
Complex searches can be difficult to implement.
Lexical information is not available.
It is read-only.
The first thing you need to read an XML document is a SAX parser that reads the document and a document handler that makes meaningful use of the data the SAX parser reads. JAXP provides a SAX parser in its distribution ...