The Basics of the SAX 1.0 Package

The SAX 1.0 package has less than a dozen interfaces and classes. They're not hard to learn. Although there are a few advanced APIs that are not often used, most of the interfaces are used regularly. This section focuses on a subset of the basic APIs that suffices to get most work done with SAX. That subset, about half a dozen calls, is enough to let you write useful SAX applications. You'll use the parser and add some callback handlers as you subclass HandlerBase.

Parsing XML Text

There are two ways to tell a parser to parse a document. First you'll look at the most widely used one, passing a URI to the parser, which you saw briefly in Chapter 13. Then you'll look at the other one (useful for parsing data ...

Get XML Unleashed 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.