There is no such thing as XHTML5

For a while, I believed that XHTML was keeping up with HTML. That you could use all the features of HTML5 in XHTML, by using the XHTML structure and file type, and HTML5 content.

The W3C and the WHATWG also strongly hint that you can write newer HTML5 material as both HTML and XHTML documents. That is, you can serve up your document with either a .html or a .xhtml extension and it will get the same treatment, the same result.

In fact, the HTML5 specification explicitly allows for XHTML-like structures in HTML5, even in HTML mode, such as the slash at the end of any void element; and the W3C proudly proclaims all the benefits of using polyglot markup and how you can serve up exactly the same content as both HTML and XHTML if you just keep to some simple rules – see http://www.w3.org/TR/html-polyglot/

So where do we stand here with this wonderful new HTML5 technology?

Well,the problem is that you can’t really give any XHTML file an HTML5 DOCTYPE and get away with it.
Any XHTML file containing entity references like é or   can no longer be displayed!

So there you have it. If you want to use a XHTML file type, you can’t use a HTML5 DOCTYPE. The HTML5 DOCTYPE is only for HTML files.

Rest in peace, XHTML.

Advertisement

Published by

MrListerSir

Pim is a programmer who programs programs.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s