Chapter 20. SAX2

The Simple API for XML (SAX) uses an event-based architecture for processing XML documents, similar to the event-based architecture employed by Swing, the Java GUI API. To use SAX, you create a class that implements one of the SAX listener interfaces (there are three of them), and register an instance of that class with a SAX parser at runtime. A SAX parser reads an XML document from a data stream sequentially, from beginning to end. As it reads the stream, the SAX parser sends events to the listener object that you registered. In other words, the parser invokes callback methods on the listener object as it encounters different parts of the XML document. For example, at the start of the XML document the parser invokes the listener's ...

Get J2EE™ Web Services now with O’Reilly online learning.

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