How does the browser know that a page is HTML?
- HTTP Message includes a Multipurpose Internet Mail Extension (MIME) Type to
indicate what is being transmitted.
- Browser sniffs the file
- Browser looks at file extension
- Browser looks at <meta> elements (unlikely)
Possible MIME Types transmitted are:
-
text/html: for HTML files but works for XHTML 1.0 and XHTML 1.1 as well
- In theory, these files will not be processed as XHTML
- Strictly, XHTML 1.1 should not be served as text/html but XHTML 1.0 can
-
Not well formed documents will be accepted
-
application/xhtml+xml: the media type that should be used
-
application/xml: generic media type for XML applications, need to add the
XML namespace as XHTML
-
text/xml: almost equivalent to application/xml