Set HTML5 doctype with XSLT

I think this is currently only supported by writing the doctype out as text: <?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=”https://stackoverflow.com/”> <xsl:text disable-output-escaping=’yes’>&lt;!DOCTYPE html&gt;</xsl:text> <html> </html> </xsl:template> </xsl:stylesheet> This will produce the following output: <!DOCTYPE html> <html> </html>

What is the functionality of !DOCTYPE?

The most significant use of DOCTYPE is to switch a browser between Quirks Mode and Standards Mode rendering. This functionality came about because of the “broken” rendering in old versions of IE. It was realised that if Microsoft just “fixed” the IE rendering engine lots of existing sites would not render properly. So the way … Read more

What is DOCTYPE?

Basically, the DOCTYPE describes the HTML that will be used in your page. Browsers also use the DOCTYPE to determine how to render a page. Not including a DOCTYPE or including an incorrect one can trigger quirks mode. The kicker here is, that quirks mode in Internet Explorer is quite different from quirks mode in … Read more

vs

In HTML5, they are equivalent. Use the shorter one, as it is easier to remember and type. Browser support is fine since it was designed for backwards compatibility.