Other Characteristics of Well-Formedness

This section covers the well-formedness constraints as they apply to areas other than elements and attributes. Several of the well-formedness rules will make more sense after you have read Chapters 4 and 5.

Comments

To be well formed, XML comments must not end with the character sequence --->. A legal XML comment ends with -->— that is, two dashes and a greater than character.

Entities Must Be Declared

If a reference to an entity is present in an XML document and any of the following are true, any entity referenced must be declared:

  • There is no Document Type Definition (DTD).

  • A document has only an internal DTD subset with no parameter entity references.

  • The value of the standalone attribute in the XML ...

Get Sams Teach Yourself XML in 10 Minutes 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.