SAX, the Simple API for XML, is an event-driven API that, rather than modeling the document, models the parser and the client application that receives information from the parser. It's suitable for documents that are fairly local—that is, situations in which processing one piece of the document does not depend heavily on content from other pieces of the document. It is extremely fast, and far and away the most memory efficient of the various XML APIs. It is the only API that can easily handle documents in the multi-gigabyte range.

SAX is divided into three packages:

  • org.xml.sax: the core classes and interfaces that all SAX parsers and most SAX programs use

  • org.xml.sax.helpers: factory classes for loading instances of the core SAX interfaces, ...

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.