SAX 2.0 Extensions
The SAX2 core includes the org.xml.sax and org.xml.sax.helpers packages, but that's not all there is to SAX. The org.xml.sax.ext package includes standardized extensions, and anyone can define and implement nonstandard ones using the SAX2 core "feature flags" and "property objects" mechanisms.
SAX2 Extensions 1.0
Part of the original motivation to create SAX2 was to let it
support better "round tripping" of XML data, so that parser outputs
would more closely match the inputs.
Another was to let it expose more of the useful DTD information.
Because not every parser would want to support those two tasks,
they were supported in optional handlers that are part of
a new SAX2 Extensions package.
These needs were met using handlers that are bound using the
The DeclHandler and LexicalHandler interface, and the whole org.xml.sax.ext package, were part of SAX2 development up through the beta2 release. After that time they were put into a separate distribution; core-only SAX2 distributions do not need to include those interfaces. Final versions of those interface were delivered many months after the original SAX2 interfaces were defined.
The SAX2r2 release re-bundles those two interfaces. They're still optional in the sense that SAX2 distributions don't need to include them. In practice, all distributions are already including them, and any distribution conforming to the JAXP 1.1 interface specification needs to include them.
SAX2 Extensions 1.1 (beta1)
Since the original release of SAX2, and 1.0 extensions, many folk have gained experience with SAX2. Naturally, some of these have led to requests for new standardized SAX features. Notably, not all of the XML Infoset information was available, so that applications which needed it couldn't be written on top of the raw SAX API. Rather than changing the SAX2 core, these new features are part of the optional extensions package.
Functionality defined in the SAX2 Extensions 1.1beta1 release includes several new classes and interfaces:
There are also several new feature flags. These are documented with all the others, in the main SAX package summary. The feature flags have the usual URI prefix. To summarize them:
At this writing, only the Ælfred2 parser supports many of these extensions. Conformance tests for them are yet to be developed.