Backward compatibility

It is very important that existing HTML-based Web browsers are able to process and present XHTML documents, and this can only be achieved by making an XHTML document pretend to be an HTML document. This requires a number of compromises to be made.

The first compromise made is in the standard itself. The root element is named 'html', not 'xhtml', for this reason.

Document authors or XHTML authoring tools need to ensure that there is a space before the '/>' markup in an empty element, as in '<br />'. Browsers will then ignore the '/' symbol.

Note that the lack of minimization features is irrelevant to this requirement, as browsers have always been able to accept non-minimized element and attribute markup.

Get XML Companion, The, Third 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.