Right now, Wordpress serves up the blog's headers by using
get_option('html_type')
which as far as I know, can only be changed in the database. Changing it to application/xhtml+xml would make sense, if the browsers would all handle it, but they all don't, which is why right now we have XHTML complaint pages served up as using the text/html mime type -- so everything can be viewed if the browser can't view the application/xhtml+xml mime type.
However, I propose a 'hack' around this issue, which should allow the older browsers to still view the pages with the text/html mime type, and the newer browsers to view the pages with the application/xhtml+xml mime type.
I'm not quite sure about all the code and just did a quick hack, which seems to work to my knowledge, so I won't include a diff, just a quick example of wp-includes/classes.php (~ 171)
@header("Vary: Accept");
if (stristr($_SERVER[HTTP_ACCEPT], "application/xhtml+xml")) {
@header('Content-type: application/xhtml+xml; charset=' . get_option('blog_charset'));
}else if (stristr($_SERVER["HTTP_USER_AGENT"], "W3C_Validator")) {
@header('Content-type: application/xhtml+xml; charset=' . get_option('blog_charset'));
}else{
@header('Content-type: text/html; charset=' . get_option('blog_charset')); }
There are prettier and more proper ways, just throwing this option out there to see what people think.