日期:2014-05-17  浏览次数:20671 次

xslt为html添加 DOCTYPE声明
<?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' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template name="DOCTYPE">
                <![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">]]>
</xsl:template>

<xsl:template match="/">
<xsl:value-of select="document('')/*/xsl:template[@name='DOCTYPE']/node()" disable-output-escaping="yes"/>

  <html>
  <head>

 </head>
  <body>

  </body>
  </html>
</xsl:template>
</xsl:stylesheet>

?