Re: HTML or XHTML - why do you use it?

On Wed, 8 Jan 2003, Toby A Inkster wrote:
> On Wed, Jan 08, 2003 at 09:42:33AM +0000, Ian Hickson wrote:
> | But it's one of the many things people get wrong, and one of the many
> | things that will screw up when people change their text/html XHTML files
> | to use a real XML MIME type.
> 
> Ian, all your arguments in this thread so far seem to revolve around the 
> fact that user agents will treat an xhtml file served as text/html 
> differently from an xhtml file served as text/xml (or application/xml or 
> application/xhtml+xml).

Yes. That is the argument.


> If a browser were to choose which rendering path to use (xml or tag
> soup)  depending on, say, the doctype (a far more reliable method, as
> most OSes do not support mime types properly for local files) then
> there would be no problem.

Actually this is something I have studied in some depths and my conclusion
is that it is simply not a workable solution.

To start with, _any_ XHTML page that isn't well formed would immediately
break. This is a HUGE number of pages on the Web, and would cause any UA
that used this sniffing technique to not be adopted by any users.

For more details on why you couldn't do this, including an explanation of
why there is no way to reliably distinguish XHTML from tag soup, see the
"Why UAs can't handle XHTML sent as text/html as XML" section of:

   http://hixie.ch/advocacy/xhtml


> While the current two major XHTML browsers (Gecko and Opera) do seem
> to rely solely on mime type, I would not be surprised if Microsoft,
> when IE finally does support XHTML, combined MIME types with some kind
> of doctype sniffing code -- they are hardly well-known for rigidly
> obeying mime types.

The well published reason they don't is to _increase_ the number of pages
that they can render despite authoring errors. There isn't any chance that
Microsoft would consider blocking millions of existing pages purely
because they looked like XHTML but actually weren't.

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 9 January 2003 09:52:44 UTC