What SAX Is and How It Differs from DOM

As you learned in Chapter 16, “The Document Object Model,” and Chapter 17, “The Document Object Model—2,” DOM programming depends on a tree-like hierarchy of nodes that implement a specified number of interfaces. SAX takes a very different approach. It uses events that occur during parsing of an XML document, and it doesn’t build a tree hierarchy in memory.

SAX programming is often done using either Java or Visual Basic. In this chapter, you will use Java to illustrate how SAX can be coded.

Brief History of SAX

Unlike most of the XML-related topics covered in this book, SAX is not a product of the W3C. It was created by members of the XML-Dev mailing list to fill a perceived gap in available tools in ...

Get Sams Teach Yourself XML in 10 Minutes 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.