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?
Use numeric HTML entities such as &
for ampersands for both the HTML and XML parsers instead of &
which are not valid entities. Usually MDN (Mozilla Developer Network) has reliable information and I loath W3Schools so December has a fairly exhaustive list and I'd also highly recommend the Unicode Character Table website.
My platform and website (link in my profile) is served as XHTML5 and utilizes UTF8 characters in place of images (fewer HTTP requests for better performance).
As far as doctypes are concerned you didn't specifically mention which versions of which browsers so you'd need to comment in order for me to look in to it. I have installers going all thew way back to Opera 2 and Mozilla Suite 0.8. :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With