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

Re: Validator doesn't send HTTP_ACCEPT headers, "Conflict between Mime Type and Document Type" warning is incorrect.

From: Sierk Bornemann <sierkb@gmx.de>
Date: Tue, 31 Jul 2007 15:37:05 +0200
Message-Id: <B93F4418-55CA-4BA0-8FAB-F881F37A6676@gmx.de>
Cc: "olivier Thereaux" <ot@w3.org>, "Andries Louw Wolthuizen" <info@andrieslouw.nl>, "www-validator Community" <www-validator@w3.org>
To: Gez Lemon <gez@juicystudio.com>


Am 31.07.2007 um 15:24 schrieb Gez Lemon:

> On 31/07/07, Sierk Bornemann <sierkb@gmx.de> wrote:

>> *without* relying on the client's Accept header?
>> Providing a solution would be very helpful, and I would be *very*
>> lucky...

> By checking if the string is found in the HTTP accept headers. As PHP
> was mentioned in the first email I saw on this subject, it can be done
> as follows in PHP:
>
> header("Vary: Accept");
> if (stristr($_SERVER[HTTP_ACCEPT], "application/xhtml+xml") === FALSE)
>     header("Content-Type: text/html; charset=utf-8");
> else
>     header("Content-Type: application/xhtml+xml; charset=utf-8");

I knowingly mentioned before "*without*" asking the browser's accept  
header, Gez. :-)
That's the brick all is about. How do you do it *without* asking the  
browser's Accept header? Hmmm?

> I only ever use XHTML 1.1 if I need the modular support of XHMTL (for
> example with WAI-ARIA), so typically do it the other way around, but I
> agree with Olivier that it is more sane to make the desired MIME type
> the default MIME type.

I also agree with Olivier. In every word. Surely. But unfortunately  
we are discussing theory against practise. :-)
How do you do it in practise? I stiil wait for a worklng solution for  
dynamic parsed content *without* writing it twice as .xhtml file and  
and as an identically .html file (and distinguish them both via  
content negttiation) -- that's only practical for some single files  
and not for dynamically served content.
For dynamically served content you unfortunately *have* to rely on  
the browser's accept header. If not, I am very open and receptive for  
a working solution concerning dynamically served content.

Sierk

-- 
Sierk Bornemann
email:            sierkb@gmx.de
WWW:              http://sierkbornemann.de/
Received on Tuesday, 31 July 2007 13:37:30 GMT

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