Is there a way to tell the web browser that the document is encoded in XHTML5, i.e. HTML5 XML serialization? This question is not as obvious as the first impression may seem. The corresponding XHTML5 header is identical to the XHTML 1.0 header, so my browser (Mozilla Firefox 18) treats XHTML5 as XHTML 1.0, thereby complaining about everything that was not available before XHTML5 arose.
According to the W3C HTML5 Candidate Recomendation, the DOCTYPE header is optional (and even incorrect for valid XML), the html namespace is exactly the same as for XHTML 1.0. So, how do we know how to classify the code below? And how does a browser distinguish two standards?
<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB"> <head> <title>A questioning document</title> </head> <body> XHTML5 or XHTML 1.0 — that is the question... </body> </html>
source share