Chapter 7. The XMLReader Interface

The XML specification grants parsers a sometimes confusing amount of leeway in processing XML documents. Parsers are allowed to validate or not, to resolve external entities or not, to treat nondeterministic content models as errors or not, to support nonstandard encodings or not, to check for namespace well-formedness or not, and much more. Depending on exactly which choices two parsers make for all of these options, they can produce quite different pictures of the same XML document. Indeed in a few cases, one parser may even report a document to be well-formed while another parser may report the same document to be malformed.

To support the wide range of capabilities among different parsers, the XMLReader ...

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.