XHTML Document Well-Formedness and Validity

The primary requirement of XHTML documents, as with any XML-based document, is that they be well-formed. Well-formedness means that all elements are written using proper syntax, they are closed where they should be, attribute values are always in quotes, and so on. Validity, which is a requirement of XHTML documents but an optional state for XML documents, requires that the syntax used in XHTML documents also conform to the document type definitions (DTDs) for those documents. You can't have elements nested within each other if the DTD prohibits it, attribute values must conform to the specified range of values, and the document must conform to any other restrictions set out in the DTD.

XHTML has three ...

Get XHTML by Example 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.