MOE Concerns: API Approaches Considered Harmful
-
SAX's ugly side
While SAX has done an excellent job of providing a (mostly) simple API for XML, and introduced the world to event-driven markup processing, its use of callbacks with fixed parameters means that it can only present certain aspects of an XML document.
-
Limiting the flow of information
While SAX does an excellent job of presenting the core structures of an XML document - element and attribute structure, names, and content - other aspects have been left to handlers which aren't always supported, or simply ignored. (A lot of whitespace and information about quotes disappears, as do things like entities in attributes.)
-
Losing extensibility
SAX2 is extensible through additional handlers. Combining these additional handlers with the existing ones can be difficult in some cases, especially when, for instance, information about attributes is involved.
-
The DOM alternative(s)
DOM is more extensible than SAX, using a more generic node architecture, but it offers no support for an event-driven approach and lacks the ability to do things like represent XML content which isn't well-formed.
Previous Page <
TOC
> Next Page