© Jeff Friesen 2016

JEFF FRIESEN, Java XML and JSON, 10.1007/978-1-4842-1916-4_2

2. Parsing XML Documents with SAX

Jeff Friesen

(1)Dauphin, Manitoba, Canada

Java provides several APIs for parsing XML documents. The most basic of these APIs is SAX, which is the focus of this chapter.

What Is SAX?

Simple API for XML (SAX)is an event-based Java API for parsing an XML document sequentially from start to finish. When a SAX-oriented parser encounters an item from the document’s infoset (an abstract data model describing an XML document’s information; see http://en.wikipedia.org/wiki/XML_Information_Set ), it makes this item available to an application as an event by calling one of the methods in one of the application’s handlers (objects whose methods ...

Get Java XML and JSON 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.