SERVING XHTML DOCUMENTS

This is an XHTML 1.0 (Strict) Test Page served via content-negotiation (PHP on the Server side) as Content Type application/xhtml+xml with XML declaration to Browsers that recognize that MIME type and as Content Type text/html without XML declaration to Microsoft Internet Explorer Browsers.

Problems serving XHTML:

XHTML (Extensible HyperText Markup Language) is defined and described in the W3C XHTML™ 1.0 Recommendation (Second Edition) XHTML Documents should be served as Content (MIME) type application/xhtml+xml to have XML functionality as prescibed by the Recommendation.

Primary Reference - serving xhtml 1.0: W3C Tutorial.

Appendix C of the Recommendation (HTML Compatibility Guidelines) provides information for Web authors who wish to produce XHTML documents that will render in HTML specific user agents. Such documents must be served as Content (MIME) type text/html -- they are really HTML rather than XHTML documents. Practically all extant XHTML pages are being served this way.

This situation will prevail until Microsoft changes its stance on support for the Content (MIME) type application/xhtml+xml.

Some Web Service Provider implementations do not recognize this content (MIME) type. In that event, the web author must contact his or her Web Service Provider to try and convince them to adopt application/xhtml+xml as the content (MIME) type to associate with XHTML documents. If that doesn't work -- and it sometimes doesn't -- then the web author is faced with the task of producing and loading up to the server an .htaccess file that provides the association.

Guide to .htaccess

Current XHTML with XML compliant browsers such as Firefox, Mozilla, Opera, Safari, et al. will retrieve and render XHTML documents served as content (MIME) type application/xhtml+xml as intended - with full XML functionality.

MSIE Browsers will not retrieve and render XHTML served as content (MIME) type application/xhtml+xml correctly. MSIE 6.0 release 2900 and 7.0 will display such pages alright but will not render xml content. MSIE 6.0 release 2800 and earlier Browsers present a download screen -- selecting OPEN displays a plain, text only page (sans style sheet) and again will not render xml. Here is an XHTML page served strictly as content (MIME) type application/xhtml+xml that can be used for reference or testing.

Microsoft's stated rationale for not recognizing XHTML documents served as content (MIME) type application/xhtml+xml is set forth at:

Microsoft MSIE 7.0 Blog

This is a dilemma for web authors and the W3C which has attempted to resolve this situation by embracing Content Negotiation -- usually via PHP on the server side as has been done with this page -- in order to offer a choice of content (MIME) type text/html or application/xhtml+xml XHTML documents to browsers so that they can render them according to their capabilities -- thus only XML compliant browsers will be served fully functional XHTML documents.

Comprehensive Reference & Programming Resource: MIME Types and Content Negotiation (Note: this was written in 2003 -- in the Summary, MS Internet Explorer 7 should be added as non-supportive of MIME type application/xhtml+xml)

The Web-Sniffer HTTP Request & Response Header Viewer can be employed to check how this, or any other, page is being served (Content-Type) to various Browsers -- specify via User agent window.

Online references that discuss this problem:

XML compliant XHTML Checking tools (XML based rather than SGML based):

Validation results for this page:

SGML Markup Validation | XML Schema Validation | CSS Validation

Creative Commons License This page, which is licensed under a Creative Commons Attribution, Noncommercial, No Derivative Works, 3.0 United States License was created by JFP (jp29@cox.net) and should be so attributed. Be sure to comply with copyright requirements accompanying externally linked pages and materials.

Link to go to the portal page