Developing Web Services with Java APIs for XML Using WSDP

Understanding Event-Based XML Parsing
Creating a SAX Parser
Parsing Data with a SAX Parser
Configuring the Parser
Handling Advanced Events
JAXP provides wrappers around two different mechanisms for processing XML data. The first is the Simple API for XML or SAX, and is covered in this chapter. The second, the Document Object Model (DOM), is covered in the next.
In the SAX model, XML documents are provided to the application as a series of events, with each event representing one transition in the XML document. For example, the beginning of a new element counts as an event, as does the appearance of text inside that element. A SAX parser reads through the XML document one time, reporting each event to the application exactly once in the order it appears in the document.
Event-based parsing has strengths and weaknesses. Very large documents can be processed with events; there is no need to read the entire document into memory at once. However, working with sections of an XML document (a record made up of many elements, for example) can become complicated because the application developer has to track all the events for a given section.
SAX is a widely used standard, but is not controlled by any industry group. Rather, it is a de facto standard that was originally developed by a single developer (David Megginson) and by others in the XML community and is now supported by an open source project (http://www.saxproject.org).
The SAX wrapper...