Convert XHTML to HTML with XSLT

After fiddling a bit with the “copy-no-ns” XSLT template, I’ve ended up with a style sheet which converts XHTML to HTML 4.01, so you can use it as a post-processing step when serving to Internet Explorer. Note that this has not been tested with alternative namespaces such as SVG or MathML.

Edit: After moving to PHP 5 and libxslt, it was necessary to trim the xmlns declarations down a bit. The new version is online now.

Edit 2: I got a bit of a surprise when reading the W3C recommendations for declaring encoding and MIME type. The new version is online, but you must provide the content type at run time (using XSLTProcessor::setParameter in PHP 5). Of course, you can just ignore that and specify your own if it’s static.