Chapter 4. Advanced SAX
The last chapter was a good introduction to SAX. However, there are several more topics that will round out your knowledge of SAX. While I’ve called this chapter “Advanced SAX,” don’t be intimidated. It could just as easily be called “Less-Used Portions of SAX that are Still Important.” In writing these two chapters, I followed the 80/20 principle. 80% of you will probably never need to use the material in this chapter, and Chapter 3 will completely cover your needs. However, for those power users out there working in XML day in and day out, this chapter covers some of the finer points of SAX that you’ll need.
I’ll start with a look at setting parser properties and
features, and discuss configuring your parser to do whatever you need
it to. From there, I’ll move on to some more handlers: the
EntityResolver and DTDHandler
left over from the last chapter. At that point, you should have a
comprehensive understanding of the standard SAX 2.0 distribution.
However, we’ll push on to look at some SAX extensions,
beginning with the writers that can be coupled with SAX, as well as
some filtering mechanisms. Finally, I’ll introduce some new
handlers to you, the LexicalHandler and
DeclHandler, and show you how they are used. When all is said and done (including another “Gotcha!” section), you should be ready to take on the world with just your parser and the SAX classes. So slip into your shiny spacesuit and grab the flightstick—ahem. Well, I got carried away with the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access