There appears to be some confusion about XHTML1.0 vs XHTML5. Here is my best shot at an explanation of what XHTML5 is.
application/xhtml+xml). See examples and more explanations.XHTML5 is an HTML5 document served as* application/xhtml+xml (or another XML mime type). The syntax rules for XHTML5 documents are simply those rules given by the XML specification. The vocabulary (elements and attributes) is defined by the HTML5 spec.
Anything served as text/html is not XHTML5.
Note that HTML5 (without the X) can be written in a style that looks like XML syntax. For example, using a / in empty elements (eg. <br/>), or using quotes around attributes. But code written this way is still HTML5, not XHTML5, if it is served as text/html.
There are normally other differences between HTML5 and XHTML5. For example, XHTML5 documents may have an XML declaration at the start of the document. HTML5 documents cannot have that. XHTML5 documents are likely to have a more complicated doctype (to facilitate XML processing). And XHTML5 documents will have an xmlns attribute on the html tag. There are a few other HTML5 features that are not compatible with XML, and must be avoided.
Similar differences existed between HTML 4.01 and XHTML 1.0. However, moving on from XHTML 1.0 will typically involve a subtle but significant shift in thinking. You might have written XHTML 1.0 with no intention of serving it as anything other than text/html. XHTML in the XHTML 1.0 sense tended to be seen largely as a difference in syntax; it was originally designed to be served as XML, but (with some customisations to suit HTML documents) could be, and usually was, served with an HTML mime type. XHTML in the XHTML5 sense, means HTML5 documents served with an XML mime type (and appropriate customisations to suit XML documents), ie. it’s the MIME type, not the syntax, that makes it XHTML.
Which brings us to Polyglot documents. A polyglot document contains markup that is the subset of HTML5 and XML that can be processed as either HTML or XHTML, and can be served as either text/html or application/xhtml+xml, ie. as either HTML5 or XHTML5, without any errors or warnings in either case. The polyglot spec defines the things which allow this compatibility (such as using no XML declaration, proper casing of element names, etc.), and which things to avoid. It also mandates at least one additional extra, ie. disallowing UTF-16 encoded documents.
« How to generate a list of Unicode characters with names and/or codepoints – Using unicode-range in font-face in CSS »

December 6th, 2011 at 6:29 pm
Richard,
so, if I am a client, how do I make the difference between XHTML1.1 and XHTML5? Both return application/xhtml+xml. Is there a standard way to do that?
January 7th, 2012 at 1:47 pm
The bad news on html5 is that some people think they traveled back to 1997 and write smelly markup. That is where the xml specs should be the way to go. I write regular html5 markup, but keep the xml specs in mind. The source is much more readable and just more … elegant
One more benefit of this approach is that you can port to several xml formats very quickly.
Nice article.
March 5th, 2012 at 5:52 pm
Simple article but essential details are included for clarity. Makes a lot of sense to move to XHTML5 rather than HTML5.
June 22nd, 2012 at 8:24 pm
Because I am not concerned with backward compatibility and happily accept the discipline of application/xhtml+xml, I was wondering whether it would be proper to amend apache’s HTTP_ACCEPT by removing ‘text/html’ and force serving everything as application/xhtml+xml. The idea is to ONLY accept that type (no fall-back) and have php notify the user agent accordingly. Failing that, I guess content negotiation is my only alternative, which means I do not understand what xhtml/xml must be defined.
I am struggling for a controlled, disciplined environment at the outset. I have used xhtml1.1 in the past without problems. (X)HTML5 is definitely my goal.
George