Well-Formedness Rules

XML documents must be well formed in order to be considered XML. The XML 1.0 Recommendation spells out some conditions that must be met for a document to be considered well formed. These conditions are called well-formedness constraints, and if the document fails to meet these constraints, it is not an XML document.

This can lead to some confusion when working with XML, as you may have a document which seems to be perfect XML, yet it will not load into your XML application. That is because if the well-formedness constraints are not met, XML parsers cannot properly load the document. This is very contrary to the behavior of most Web browsers, which are very forgiving of errors in HTML.

It would be impossible to enumerate ...

Get Special Edition Using XML, Second Edition 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.