This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
I am serving an XHTML 1.1 Strict document via PHP. I use the fallowing PHP code to check if the browser supports the "application/xhtml+xml" content type and serve the appropriate type: header("Vary: Accept"); if(stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) header("Content-Type: application/xhtml+xml; charset=utf-8"); else header("Content-Type: text/html; charset=utf-8"); This code works very well for actual browsers, but creates a warning if I try to validate the site. This is because your site doesn't provide the proper information in it's HTTP header. I know this is a minor bug, but it's frustrating having perfect markup, but still having that one error pop up every time. Thanks for looking into this! - Peter Hanneman hannemanp@gmail.com
(In reply to comment #0) > I am serving an XHTML 1.1 Strict document via PHP. I use the fallowing PHP > code to check if the browser supports the "application/xhtml+xml" content type > and serve the appropriate type: > > header("Vary: Accept"); > if(stristr($_SERVER["HTTP_ACCEPT"], "application/xhtml+xml")) > header("Content-Type: application/xhtml+xml; charset=utf-8"); > else > header("Content-Type: text/html; charset=utf-8"); You could send application/xhtml+xml if no Accept: is sent, and only send as text/html for agents that send an Accept: but do not include application/xhtml+xml. > This code works very well for actual browsers, but creates a warning if I try > to validate the site. The warning has been removed from the version to be released. http://qa-dev.w3.org/wmvs/HEAD/ This is because your site doesn't provide the proper > information in it's HTTP header. I know this is a minor bug, but it's > frustrating having perfect markup, but still having that one error pop up every > time. Warning, not error. Also, if that really frustrates you, you may want to look into http://validator.localhost/docs/users.html#option-accept
(In reply to comment #1) > http://validator.localhost/docs/users.html#option-accept Should read: http://validator.w3.org/docs/users.html#option-accept