© Jeff Friesen 2019
Jeff FriesenJava XML and JSONhttps://doi.org/10.1007/978-1-4842-4330-5_2

2. Parsing XML Documents with SAX

Jeff Friesen1 
(1)
Dauphin, MB, Canada
 

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

What Is SAX?

Simple API for XML (SAX) is an event-based Java API for parsing an XML document sequentially from start to finish. As 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: Document Processing for Java SE 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.