xsl-list
[Top] [All Lists]

Outputting the DOCTYPE tag to XHTML

2003-03-30 09:07:25
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



<Prev in Thread] Current Thread [Next in Thread>