SAX

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.