This concise book gives you the information you need to effectively use the Simple API for XML (SAX2), the dominant API for efficient XML processing with Java. By using the SAX2 API, developers get access to the information in XML documents as they are read, without facing major memory constraints or a large code footprint. SAX2 is often used by other APIs under the hood, and provides a foundation for processing and creating both XML and non-XML information. SAX2 explains this compact and highly functional API in detail. It covers how to use SAX2 callbacks to report the information in an XML document as the document is read, allowing you to create your own program structures around the content of documents. You'll learn to work without the extra overhead of an intermediary model of an entire XML document. You'll also explore how to create mappings from XML structures to Java structures and back.
While generally considered the most efficient approach to handling XML document parsing, SAX2 also, carries a significant learning curve. Many of SAX2's more advanced features are both obscure and powerful. In this book, author David Brownell explores : The details of managing XML parsers ; How to filter, modify, and restructure the information that XML parsers return ; Techniques for using SAX2 events to convert non-XML information to an XML form ; Strategies for using event-based parsing in a variety of application scenarios ; Limitations that applications need to address in ways that meet their particular needs. Both developers learning about SAX2 for the first time and developers returning for reference and advanced material about SAX2 will find useful information in this book. Chapters provide detailed explanations and examples of many aspects of SAX2 development, while appendixes provide a reference to, the API and an explanation of the relationships between die SAX2 API and the XML Information Set.