Chapter 12. Java and SAX

The previous chapter was all about using Java and the XML DOM. Some people, however, find using the DOM difficult and see the whole concept of treating an XML document as a tree unnecessarily complex. Rather than having to navigate through the whole document, they say, wouldn't it be great if the whole document came to you? That's the idea behind the Simple API for XML (SAX), and this chapter is dedicated to it. SAX really is a lot easier to use for many—possibly even most—XML parsing that you have to do.

You may be surprised to learn that we've already been putting the idea behind SAX to work throughout the entire previous chapter. You may recall that in that chapter, I set up a recursive method named display that was ...

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