How to provide an XHTML5 interpretation of a web document?

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> 
+4
source share
2 answers

<iframe> in XHTML5 (i.e. XML mode) works fine in Firefox. But you need to identify the iframe with the id attribute, not the name attribute.

For IE9, on the other hand, you need to use the name attribute, not the id attribute.

It is best to use both, set the same value.

See http://www.alohci.net/application/xhtml+xml/iframe-in-xml.htm.ashx for an example.

+1
source

Please check out these links about the future of XHTML and why you might only see confirmation from XHTML 1.0:

http://www.w3.org/2009/06/xhtml-faq.html

https://softwareengineering.stackexchange.com/questions/149839/is-xhtml5-dead-or-is-it-just-an-synonym-of-html5

0
source

All Articles