HTML5 is a joke in it's current state and is neither forward nor backwards compatible. Additionally <all_elements href="virus.exe" is one of the stupidest things anyone has every thought up.
XHTML 1.0 Strict is and will remain for a very long time the
best option however you'll want to do content negotiation as IE will not add XHTML support until their CSS is solid...so this is a big maybe for IE9.
My site supports
media type (mime) and
doctype options so you can manually test out how various combinations of doctypes and media types interact with various browsers. Opera 7+, Gecko 0.9+, and from what I can tell most if not all versions of WebKit all support XHTML (true XHTML requires application/xhtml+xml support). Again IE9 is the earliest we
may see XHTML support.
The script below will serve the best media type the given browser can support. If you use XHTML 1.0 Strict you will
not have to worry about serving the page either as text/html or application/xhtml+xml. However going with a lower or higher doctype is not permitted to serve the page the page as either or (though it will still technically work). Lastly do not serve pages as application/xhtml+xml to friendly bots.
Code: Select all
<?php
if ($settings->get('mediatype') == "ns")
{
$mime = (stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) ? "application/xhtml+xml" : "text/html";
header("content-type:$mime;charset=$charset");
}
?>