• Deliverance Discussion

Set HTML5 doctype cleanly and properly?

from Jon Hadley on Aug 04, 2010 08:36 AM
Is there a clean, correct way to set the HTML5 doctype via
collective.xdv / Deliverance?

The only way I can seem to set HTML5 doctype seems to be via XSLT,
using the *non-standard*

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output
      doctype-public="HTML"
      doctype-system=""/>
</xsl:stylesheet>


The two standard approaches

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" encoding="utf-8" indent="yes" />

  <xsl:template match="/">
    <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
    <html>
    </html>
  </xsl:template>

</xsl:stylesheet>

or

  <xsl:output doctype-system="about:legacy-compat"/>

Either give an error, or produce
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

(More info: http://stackoverflow.com/questions/3387127/set-html5-doctype-with-xslt/)
Return to date view: threaded or flat