Summary

This chapter looked at the bare essentials of XML parsing and parsers. It looked at some of the decisions that a parser is required to make, whether it's a validating parser or a nonvalidating parser.

The essential point is that XML requires the parser to act in a Draconian manner when faced with a document that is not well-formed, and it requires the parser to stop parsing the document in a normal manner.

This has two basic effects:

  1. It forces authors of XML to write correct documents.

  2. It makes the job of the parser much easier because it isn't required to make sense of a bad document.

You also saw that there are essentially two types of parsers, those that build a document tree and those that parse a document as a flat file. The reasons ...

Get XML Unleashed 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.