W3C home > Mailing lists > Public > www-validator@w3.org > April 2008

Re: please add Accept header to http request containing application/xhtml+xml

From: David Dorward <david@dorward.me.uk>
Date: Sun, 20 Apr 2008 21:48:08 +0100
Message-Id: <213BFC2B-496E-4B4C-94B0-A62E952D6CCC@dorward.me.uk>
To: www-validator@w3.org

On 20 Apr 2008, at 21:15, Etienne Miret wrote:
> David Dorward wrote :
>> If you are doing content negotiation and then sending exactly the  
>> same content, but with different Content-Types, then the validator  
>> is going to get the same data either way - so it makes no difference

> Actually it makes a difference. If the page is XHTML, the validator  
> will issue a warning when it is sent as text/html.

Only if you are serving a version of XHTML marked as "SHOULD NOT be  
served as text/html" - which you shouldn't be doing. The validator  
doesn't give such a warning for XHTML 1.0. http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2F

>> (and the content negotiation is pretty pointless).
> Not really, Web browser will usually handle a document differently  
> depending of its media-type. Typically, a text/html document will be  
> processed by an SGML parser,

No, typically it will be processed by a tag soup parser.

> whereas an application/xhtml+xml document will be processed by an  
> XML parser.

So what?

The net result is just that you get a few minor inconsistencies in how  
the DOM appears (e.g. tbody elements are optional rather then implied  
in XHTML), lose incremental rendering in some browsers (Firefox 2 for  
instance), lose support for document.write, lose the magic handling of  
the body elements as regards CSS in some browsers, and have to write  
your JS in such a way that it can switch between regular and namespace  
aware DOM methods.

There is no point in serving up exactly the same document with  
different content-types.

Content negotiation would be useful if, for instance, you had an XHTML 
+MathML document and an HTML document with the MathML converted to  
images or text, and you switched between the two, but for just the  
content-type? Waste of time and effort.

-- 
David Dorward
http://dorward.me.uk/
http://blog.dorward.me.uk/
Received on Sunday, 20 April 2008 20:48:50 GMT

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