XSLT页面显示在FIREFOX中

时间:2015-12-03 13:49:46

标签: html xml firefox xslt

我在现有的.XSL文件中进行了更改,以使其与HTML5兼容。在所有浏览器中一切正常,但在 Firefox 的情况下,Doctype标签!Doctype html 显示在内容的顶部。

以下是代码,我使用的是:(除了firefox之外,所有浏览器都能正常工作)

  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0"  xmlns="http://www.w3.org/1999/xhtml">      

  <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text> 

  <xsl:template match="/"> 

  =================Contents of the Page======================

如果我尝试这个:

  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   version="1.0"  xmlns="http://www.w3.org/1999/xhtml">

  <xsl:output method="html" doctype-system="about:legacy-compat" encoding="UTF-8" indent="yes" />

  <xsl:template match="/">

  =================Contents of the Page======================

获取错误 解析XSLT样式表失败。

如何防止Firefox显示!Doctype html 标记?

有什么建议吗?

0 个答案:

没有答案