[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Outputting the DOCTYPE tag to XHTML


Subject: [xsl] Outputting the DOCTYPE tag to XHTML
From: Gan Uesli Starling <alias@xxxxxxxxxxx>
Date: Sun, 30 Mar 2003 11:07:25 -0500

How do I get XSLT to insert this....

  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

...into my XHTML output? Is a problem

This does not work...

<xsl:template match="/">
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <xsl:apply-templates select="howto/head"/>
    <xsl:apply-templates select="howto/body"/>			
  </html>
</xsl:template>

...because it is mal-formed. As is this too...

<xsl:template match="/">
  <&#33;DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <xsl:apply-templates select="howto/head"/>
  <xsl:apply-templates select="howto/body"/>			
  </html>
</xsl:template>

And this does not work...

<xsl:template match="/">
  <xsl:text>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;</xsl:text>
  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <xsl:apply-templates select="howto/head"/>
    <xsl:apply-templates select="howto/body"/>			
  </html>
</xsl:template>

...because it prints out the text in the doc.

What is the correct way, please?

Thanks,

Gan

--

Mistera Sturno - Rarest Extinct Bird

 <(+)__       Gan Uesli Starling
  ((__/)=-    Kalamazoo, MI, USA
   `||`
    ++        http://starling.us


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords