I've been considering converting my current HTML5 documents to polyglot HTML5 ones. I figure that even if they only ever get served as text/html
, the extra checks of writing it XML would help to keep my coding habits tidy and valid.
Is there anything particularly thrilling in the HTML5-only space that would make this an unwise choice?
Secondly, the specs are a bit hazy on how to validate a polyglot document. I assume the basics are:
- No errors when run through the W3C Validator as HTML5
- No errors when run through an XML parser
But are there any other rules I'm missing?
Thirdly, seeing as it is a polyglot, does anyone know any caveats to serving it as application/xhtml+xml
to supporting browsers and text/html
to non-supporting ones?
Edit: After a small bit of experimenting I found that entities like
break in XHTML5 (no DTD). That XML parser is a bit of a double-edged sword, I guess I've answered my third question already.