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

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 UTC