Transforming to XHTML with XSLT

As XHTML is valid XML you will need to create a stylesheet that outputs XML with the correct XHTML namespaces.

Below is an example of a stylesheet to use:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    <xsl:template match="/">
       <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
          <!-- some content here -->
       </html>
    </xsl:template>
</xsl:stylesheet>

Last updated: 28/11/2007