Alan Milnes wrote:

The correct content type or MIME type for an XHTML document is
"application/xhtml+xml".
Although I might add internet explorer doesn't understand it so you need
to determine if the users browser accepts it.You can do this in PHP by
writing:



::::: SNIP:::::

The suggested method doesn't work when you go to validate your pages, see
the discussion at:

http://www.xml.com/pub/a/2003/03/19/dive-into-xml.html

Alan

*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************




That is because w3c doesn't send the server it's accepted MIME types. You can fix this by:

<?php
if(strstr($_SERVER['HTTP_ACCEPT'],"application/xhtml+xml") || strstr($_SERVER['HTTP_USER_AGENT'],"W3C_Validator"))
header("Content-type: application/xhtml+xml");
else
header("Content-type: text/html");
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">\n";
?>


*****************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
*****************************************************




Reply via email to