SAX Event Handling

The most striking difference between the previous versions of Cocoon and the current release (included on the companion CD) is the XML processing. It has shifted from the memory-consuming DOM model to the event-based SAX model. Whereas the DOM model creates Java objects in main memory that represent the XML document, the SAX model is event-based.

The SAX model consists of a set of interfaces and classes. We will not present every detail of the SAX model, because that would make this book quite heavy. Instead, we will focus on the essential parts.

The most important part of SAX is the set of events sent by the XML parser to a component that is “listening” for them. This component can then decide what to do by acting on the ...

Get Cocoon: Building XML Applications 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.