Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an advantage to using the XHTML 1.1 doctype with the "text/html" MIME type instead of an HTML doctype?

XHTML 1.1 is intended to be used with the "application/xhtml+xml" MIME type. Yet almost no one does this, because IE doesn't handle the "application/xhtml+xml" MIME type correctly, and draconian error handling is seen as being unfriendly to users.

If our site is stuck with the "text/html" MIME type, is there any advantage to using the XHTML 1.1 doctype over HTML4 or HTML5?

like image 957
Eric the Red Avatar asked Jan 19 '11 18:01

Eric the Red


1 Answers

See this 8-year-old discussion of this very topic, which leads to this in-depth article. In short: there are disadvantages to doing so. Do not do it.

The executive summary, from the article:

If you use XHTML, you should deliver it with the application/xhtml+xml MIME type. If you do not do so, you should use HTML4 instead of XHTML. The alternative, using XHTML but delivering it as text/html, causes numerous problems that are outlined below.

like image 63
Phrogz Avatar answered Sep 25 '22 02:09

Phrogz