Rants, rambles, news and notes from another geek

XHTML MIME Type in Internet Explorer

I was interested in playing around with XSLTunit, which is a unit testing framework for XSLT, but I found that Internet Explorer wouldn’t open it. It kept popping up a “Save As…” dialog box. Hmmm…

So I fired up Fiddler to see what the MIME type was that was being sent by the server. It was “application/xhtml+xml” which was a MIME type that I had never seen before. After a bit of googling, I discovered that “application/xhtml+xml” is the correct MIME type for XHTML files!

Although a number of people seem to think that Internet Explorer doesn’t support it, the real answer is that it is just missing an entry in the registry to tell it what to do with that MIME type. At least, that is all I had to do to get it to work. (I’m sure some XHTML purist will say that IE is still broken even with this hack, but I don’t really care. All I wanted was to be able to browse the XSLTunit web site!)

Here is the registry entry you need to add. Put this into a text file named “xhtml_mime.reg” and double click on it. Then you should be able to view the XSLTunit site (and any others that use the new XHTML MIME type).

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/xhtml+xml]

(This was tested on Windows XP SP2, your mileage may vary on other systems.)