XHTML for IE

Friday, 15 Apr 2005 [Saturday, 16 Apr 2005]

So now my site “works” in Internet Explorer. I’m still delivering XHTML, too. What I did was to change from a MIME type of application/xhtml+xml to application/xml. This is not preferred according to the spec, but is explicitly allowed.

The only issue is that I had to remove the DTD because IE chokes when it tries to parse http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd. If there is an actual syntax error that will be easy to fix, of course. In the meantime, I am not sure of the ultimate validity of my pages without the declaration. However, the validator still gives its blessing (albeit tentatively) if asked to consider them to be XHTML 1.1, Gecko renders them in standards compliance mode after giving them the draconian parsing treatment, and even Explorer applies ultrastrict parsing rules! This is good enough for me.

I put “works” in quotes because Explorer does not actually produce an intelligible rendering. It obviously has no builtin CSS defaults for HTML rendering that would apply to XHTML documents, so to really make it work, it will require a minimal stylesheet that appropriately assigns display: block and display: inline and maybe a few other properties to the various elements.

And they said it couldn’t be done.

Update: apparently, this is old news.