wfsp has asked for the wisdom of the Perl Monks concerning the following question:
Ian Hickson argues that Sending XHTML as text/html Considered Harmful.
Brad Fults, in: Sending XHTML as text/html Considered Harmful to Feelings, is not convinced.
The www.w3.org themselves seem to agree: Why is it allowed to send XHTML 1.0 documents as text/html?
What really attracted my attention was, as Ian Hickson suggests, opening http://www.mozillaquestquest.com/ in IE. It does indeed show a DOM tree (in IE7 as well as the IE6 that he mentions).
This was compounded by the apparent attitude of w3.org (excerpts from the link above):
Which browsers accept the media type application/xhtml+xml?Have I misunderstood something here? To my reading those statements could be considered contradictory.
... In fact, any modern browser. ...
Does Microsoft Internet Explorer accept the media type application/xhtml+xml?
No. ...
The w3.org then describes a "a trick that allows you to serve XHTML1.0 documents to Internet Explorer as application/xml." It involves adding:
to every XHTML file and for the site to have the following file:<?xml-stylesheet type="text/xsl" href="copy.xsl"?>
w3.org explain that:<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"> <template match="/"> <copy-of select="."/> </template> </stylesheet>
Although you are serving the document as XML, and it gets parsed as XML, the browser thinks it has received text/html, and so your XHTML 1.0 document must follow many of the guidelines for serving to legacy browsers."Standards" that need "tricks" to work (for some definition of work) in a popular browser.
I find all this scary. I'm in favour of adhering to the latest standards and I bought into the idea of XHTML for all the reasons w3.org put forward. I have spent a lot of time and effort refactoring a medium sized website to validate against XHTML (amongst other things).
I must admit that at the moment I think Ian Hicks has the right idea:
Authors who are not willing to use one of the XML MIME types should stick to writing valid HTML 4.01 for the time being. Once user agents that support XML and XHTML sent as one of the XML MIME types are widespread, then authors may reconsider learning and using XHTML.The website I maintain has a non-techie audience and ignoring IE (however tempting that may be) is clearly not an option.
Do you serve up HTML or XHTML? If the latter, which mime type do you use?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: OT: How do you serve up XHTML?
by Joost (Canon) on Sep 15, 2007 at 14:42 UTC | |
Re: OT: How do you serve up XHTML?
by samtregar (Abbot) on Sep 15, 2007 at 17:41 UTC | |
Re: OT: How do you serve up XHTML?
by Cap'n Steve (Friar) on Sep 16, 2007 at 07:39 UTC | |
Re: OT: How do you serve up XHTML?
by moritz (Cardinal) on Sep 16, 2007 at 10:21 UTC | |
Re: OT: How do you serve up XHTML?
by ww (Archbishop) on Sep 16, 2007 at 21:15 UTC | |
by Cap'n Steve (Friar) on Sep 17, 2007 at 03:01 UTC | |
by amarquis (Curate) on Sep 17, 2007 at 13:04 UTC | |
Re: OT: How do you serve up XHTML?
by amarquis (Curate) on Sep 17, 2007 at 13:20 UTC |