Post Sent
  • Deliverance Discussion

Re: Set HTML5 doctype cleanly and properly?

from Laurence Rowe on Aug 04, 2010 02:28 PM
On 4 August 2010 13:36, Jon Hadley <me@...> wrote:
> Is there a clean, correct way to set the HTML5 doctype via
> collective.xdv / Deliverance?

You must use XHTML 1.0 Strict as the doctype if you want XHTML output
consistent with HTML5, libxml2's xml serializer has a special output
mode triggered by the XHTML 1.0 doctypes that ensures output is XHTML
compatible, (e.g. <br /> rather than <br/>, <div></div> rather than
<div/>). doctype-system="about:legacy-compat" does not trigger this
compatibility mode

If you are happy with html output, then setting <xsl:output
method="html"> should do the right thing. You can then set the doctype
with <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE
html&gt;</xsl:text>, though this will need plumbing in at the
appropriate place as XDV does not support this yet.

XHTML 1.0 Strict is listed as an `obsolete permitted doctype string`,
so it is perfectly acceptable to use this doctype and still call it
HTML5. (http://dev.w3.org/html5/spec/Overview.html#obsolete-permitted-doctype-string)

Laurence
Return to date view: threaded or flat