Friday, July 16, 2004

XHTML and IE — so close

I prefer to code against XHTML 1.1, primarily because it is quite spartan in its overlap with HTML 4.01, so pushes me to think about fancy effects. And yes, it really should be served as application/xhtml+xml. But that makes IE choke.

Now Dean Edwards has shown that you can persuade IE to take XHTML 1.0 served as application/xml, if you feed it an XSLT stylesheet (with perhaps a questionable MIME type).

My experiments have shown that

  • IE can handle either flavour (strict or transitional) of XHTML 1.0 this way, but not XHTML 1.1
  • IE always tries to find the DTD from the DOCTYPE, so you can't test your pages off-line with the DTD
  • If you make the DOCTYPE URL relative, IE will look at it, but not look for entity definitions - so   has to be replaced by   &c.
  • You need to add a body {margin : 0;} rule to your CSS
  • While IE conditional comments can hide a local URL DOCTYPE from other browsers, it doesn't work in reverse; IE's downlevel conditional comments don't work in e.g. Firefox, and are invalid code in any case
  • and even if you live with a local DTD, and any nagging validation doubts for doing so, if your web server doesn't serve up an .xsl file with a suitable MIME-type, Firefox gives you the yellow screen of disdain.

Conclusion: it's a neat idea, but not yet ready for prime-time. If you are always on-line and control your own web server to get the right MIME-types, maybe you might make your pages as .xml files. And we still can't get XHTML 1.1 shown properly on the majority browser. *sigh*

Post a Comment