The general advantages of SAX include:

  • The nature of a streaming model means that you need far less memory to process large XML documents.
  • You do not have to process the entire document. Use callback procedures or methods to identify and respond to only the XML elements you are interested in.
  • You can halt the parse at any time.
  • You can parse an XML document that is not well formed.
  • SAX provides callback procedures that let you to provide more error handling.