DEVFYI - Developer Resource - FYI

What's about an assumption with XHTML?

XHTML Interview Questions and Answers


(Continued from previous question...)

14. What's about an assumption with XHTML?

Serving XHTML with a MIME type of text/html is wrong. The whole point of XHTML is that it’s XML so that you can benefit from namespaces and the like. If you serve it as text/html, you can’t:
In particular, ‘text/html’ is NOT suitable for XHTML Family document types that adds elements and attributes from foreign namespaces, such as XHTML+MathML [XHTML+MathML].
Source: http://www.w3.org/TR/xhtml-media-types/#text-html
Two choices:
1. XHTML 1.0 served as application/xhtml+xml to conforming UAs, and text/html to Internet Explorer
2. HTML 4.01, served as text/html
XHTML 1.1 is not an option because it mandates a MIME type of application/xhtml+xml which is incompatible with Internet Explorer

(Continued on next question...)

Other Interview Questions