Why This Site Won’t Use application/xhtml+xml
Adrian Sutton
Byron and I seem to be heading for another round of make it standard or make it work discussion. In this case, Byron pointed out that pages on this site are served as text/html instead of application/xhtml+xml. After some brief investigation, here’s why I’ll be sticking with text/html:
It works. application/xhtml+xml doesn’t.
Firstly, apparently IE 6 doesn’t support application/xhtml+xml, at least according to http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html so I’d have to dynamically detect the browser and change the mime type anyway. I really must start up my PC and check how the entire site looks on IE for Windows for myself - I haven’t bothered as yet.
Secondly and more importantly, both Safari and Chimera get application/xhtml+xml wrong anyway. You’ll notice at the top of this page’s source is a reference to a DTD, that’s really important as it defines a whole range of entities like which are used in quite a few places around the site and in quite a few entries. Neither Safari nor Chimera parsed that DTD and as a result displayed the entities as a literal (which is completely wrong anyway, using an unknown entity should have resulted in an error).
So until the browsers can actually sort this mess out, I’m sticking with text/html since it works. You still get all the benefits of XHTML if you want to parse and process the content outside of a browser (or in your own browser etc) but by serving it as text/html it will actually work inside browsers too.
Sorry Byron…