W3C home > Mailing lists > Public > www-validator@w3.org > August 2007

Re: Page Validates But Mime Warning Continues

From: David Dorward <david@dorward.me.uk>
Date: Fri, 31 Aug 2007 14:31:07 +0100
Message-Id: <6163A1EF-55CE-4278-A529-3622FB2A3609@dorward.me.uk>
To: www-validator Community <www-validator@w3.org>

On 31 Aug 2007, at 13:39, Sierk Bornemann wrote:
> XHTML 1.0 is *surely* supported by Internet Explorer, as long as  
> you serve this document with the MIME type "text/html"

This is one of those "If a tree falls and nobody is around, does it  
still make a sound?" questions.

As far as Internet Explorer is concerned, the document is tag soup.  
Its treated like HTML 4.01. XHTML isn't explicitly supported, the  
browser just copes because the language is similar enough to what it  
does support.

> If you want to serve correctly, use either XHTML 1.0 and serve it  
> as "text/html" (then even IE does understand that), or serve as  
> "application/xhtml+xml" (then IE doesn't understand, and there must  
> be a serverside switch or something like that), which  
> distuingishes, which client browser is used meaning if it does  
> understand "application/xhtml+xml" or not. If yes, serve with the  
> recommended mimetype "application/xhtml+xml", if no, stick to "text/ 
> html".

What's the point of that though? You just get issues dealing with the  
different ways that JavaScript and CSS interact with XML documents  
and tag soup documents, and you can't use any of the features that  
XML adds (because if you do then you are no longer "HTML compatible"  
so the "MAY serve as text/html" doesn't apply.

> If you serve an XHTML document as "application/xhtml+xml", you  
> automatically serve it as an XML document and not as an SGML  
> document, as you would do, if you serve it with "text/html".  
> Consequentely it is useless to use a Meta element in the document  la
> <meta http-equiv="Content-Type" content="application/xhtml+xml;  
> charset=iso-8859-1" />, because the XML parser doesn't attend it.

Tag soup parsers only (but not always) pay attention to the character  
set part of that anyway.

On the subject of being HTML compatible. The (vague, wishy washy)  
guidelines say that you should avoid using an XML prolog, while the  
XML spec requires that you use one if you don't use UTF-8 or UTF-16,  
so this document (which claims to be ISO-8859-1) probably shouldn't  
be served as text/html anyway. The quality of Appendix C and the lack  
of clarity over what constitutes an HTML compatible document are  
major influences on my choice to avoid client side XHTML except in  
exceptional circumstances.

-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Received on Friday, 31 August 2007 13:31:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:25 GMT