The prolog, strict mode, and XHTML in IE

I realized as I read through the comments to my last blog post that I forgot to mention one important item that was in my presentation.  We have fixed the DOCTYPE switch so it will skip an XML prolog, so that valid XHTML can be handled in strict compliance mode rather than quirks mode.

I’ve also been reading comments for some time in the IEBlog asking for support for the “application/xml+xhtml” MIME type in IE.  I should say that IE7 will not add support for this MIME type – we will, of course, continue to read XHTML when served as “text/html”, presuming it follows the HTML compatibility recommendations.  We fixed the problem with our DOCTYPE switch explicitly so that this mechanism is easier to use, and it is generally easy to set up most servers to conditionally serve content as “text/html” when the “application/xml+xhtml” MIME type is not supported.

Why aren’t we supporting XHTML when it’s served as the “application/xml+xhtml” media type in IE7?  I made the decision to not try to support the MIME type in IE7 simply because I personally want XHTML to be successful in the long run.  I love XHTML (go look, my name is in the credits for XML 1.0); it’s capable of being truly interoperable if done right.  With most of our platform resources in IE7 outside of security work being spent on improving our CSS support, if we tried to support real XHTML in IE 7 we would have ended up using our existing HTML parser (which is focused on compatibility) and hacking in XML constructs.  It is highly unlikely we could support XHTML well in this way; in particular, we would certainly not detect a few error cases here or there, and we would silently support invalid cases.  This would, of course, cause compatibility problems based on parser error handling in the future, which XML is explicitly trying to avoid; we don’t want to cause another mess like the one with current HTML error handling (rooted in compatibility with earlier browsers – you can blame me for that personally somewhat, but not IE).  I would much rather take the time to implement XHTML properly after IE 7, and have it be truly interoperable – but I did want to unblock deployment of XHTML as best we could, which is why we made sure to address the XML prolog/DOCTYPE issue.

 - Chris Wilson