Event-Based Parsing of XML

The XML API discussed in the previous chapter was based on a tree representation of an XML document, which is a logical approach because XML document content forms a tree structure. However, for many types of applications, this way of handling documents is extremely inefficient—like reading a thousand Yellow Pages entries to find a phone number of a restaurant.

This chapter will discuss another way of dealing with XML documents. This API—the Simple API for XML—is not a Recommendation of the W3C, but it is a de facto standard for XML parsing and is absolutely free for both commercial and noncommercial use.

SAX: A Simple API for XML

The SAX is a result of a successful attempt to bring together ideas implemented in different ...

Get Special Edition Using XML, Second Edition 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.