I'm switching from XHTML 1.0 Strict to XHTML5, but I'm having issues with the default DOCTYPE declarations -- the documents no longer validate as XML, and cannot be loaded in some browsers when served as application/xhtml+xml
with the .xhtml
extension, mostly because of the entities like —
etc.
I've tried just putting back the XHTML 1.0 Strict
DOCTYPE
and stuff, and it all works in the browsers as expected (no XML parsing errors, and the new article
elements still work all right), but it no longer validates by W3 as valid HTML5, due to the meta charset
specification from HTML5, for example.
How do I automatically import the entities to make the browser validate XML, but specify HTML5 for the W3 validator?