Return to Snippet

Revision: 5486
at March 11, 2008 19:47 by neal_grosskopf

Initial Code
If InStr(Request.ServerVariables("HTTP_ACCEPT"), "application/xhtml+xml") > 0 Then
    Response.ContentType = "application/xhtml+xml"
    Response.ContentType = "application/xml"
End If
Response.Charset = "utf-8"
<?xml-stylesheet type="text/xsl" href="xhtml.xsl"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">

<html xmlns="" xml:lang="en">


Contents of xhtml.xsl file

<stylesheet version="1.0"
    <template match="/">
        <copy-of select="."/>


Initial URL

Initial Description
Serve your xhtml pages correctly with this script and xsl file. Most websites serve their xhtml pages as text and not xml to Internet Explorer. With this it will serve to IE as xml. Your sites will be more valid because they will validate against the xml validator rather than the html validator.

Initial Title
How To Serve XHTML to Internet Explorer 6 And 7 as XML Using Content Negotiation

Initial Tags
ie, xhtml, xml, ie6

Initial Language