Chapter 5. Reading XML

Writing XML documents is very straightforward, as I hope Chapters 3 and 4 proved. Reading XML documents is not nearly as simple. Fortunately, you don't have to do all the work yourself; you can use an XML parser to read the document for you. The XML parser exposes the contents of an XML document through an API, which a client application then reads. In addition to reading the document and providing the contents to the client application, the parser checks the document for well-formedness and (optionally) validity. If it finds an error, it informs the client application.

Get Processing XML with Java™: A Guide to SAX, DOM, JDOM, JAXP, and TrAX 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.