Chapter 12. Java and SAX

The previous chapter was all about using Java and the XML DOM. However, some people find using the DOM difficult and think that the whole concept of treating an XML document as a tree is 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. If you need to know the hierarchy of a document, use DOM methods; if you don't, you might try SAX.

You may be surprised to learn that we've already been putting the ideas behind SAX to work throughout the entire ...

Get Real World 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.