title: How to output <!DOCTYPE html> with XSLT
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3387127/set-html5-doctype-with-xslt">Set HTML5 doctype with XSLT</a>  </p>
  </blockquote>
  
  
  
  <p>I'm new to xslt and I'm trying to produce an HTML 5 document. </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  
  &lt;xsl:template match="/"&gt;
    &lt;!DOCTYPE html&gt;
  </code></pre>
  
  <p>and Firefox gives me the error </p>
  
  <pre><code>"XML Parsing Error: not well-formed
  Location: file:///E:/XSLT-XML-Shema/shipping-transform.xsl
  Line Number 6, Column 4: &lt;!DOCTYPE html&gt;
  </code></pre>
  
  <p>If it's just <code>&lt;html&gt;</code> it works fine. How do I fix this and why does it happen?</p>
  
  <p>--EDIT--</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="html" doctype-system="about:legacy-compact" /&gt;
  &lt;xsl:template match="/"&gt;
          &lt;!DOCTYPE html&gt;
  
          &lt;head&gt;
                  &lt;meta charset="utf-8" /&gt;
              &lt;title&gt;Sample Corporation #1&lt;/title&gt;
              &lt;/head&gt;
              &lt;body&gt;
              Hello this is a test&lt;br /&gt;
              Goodbye!
              &lt;/body&gt;
              &lt;/html&gt;
  &lt;/xsl:template&gt;
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>