Other Core Features of SAX

Although the parts of SAX that you've seen so far are clearly useful for getting work done, most applications will use a slightly richer feature set.

More Ways to Use Parser.parse()

Robust applications need more flexibility about how they provide data to a parser, and in particular about error handling, than has been illustrated in the preceding basic programming interfaces. SAX offers such flexibility.

Parsing from an InputSource

You've seen the first, and most common, way to invoke a parser—pass it a URI. The second way to tell a SAX Parser to parse a document is to describe the document using an InputSource object (InputSource objects will be discussed in detail later in this chapter). You create and configure ...

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.