大网数据广告活动
Web 标准与前端开发

Common XSLT Errors

· 52CE 我爱测

Your server needs to send both the source and the stylesheet with an XML mime type, `text/xml` or `application/xml`. To find out the current type, load the file in Mozilla and look at the page info. Or use a download tool, those usually tell the mime type.

MIME types

Your server needs to send both the source and the stylesheet with an XML mime type, text/xml or application/xml. To find out the current type, load the file in Mozilla and look at the page info. Or use a download tool, those usually tell the mime type.

In Firefox 6 and forward, you can also use the official XSLT mimetype: application/xslt+xml.

Namespace

The XSLT 1.0 namespace is http://www.w3.org/1999/XSL/Transform. Older versions of IE used a different namespace. However these versions also used a draft version of XSLT which is incompatible with what eventually became the XSLT 1.0 specification. Firefox only supports the official XSLT 1.0 version.

Missing features

There are some features in the XSLT 1.0 specification which Firefox unfortunately does not yet support. Specifically:

  • The namespace:: axis in XPath expressions. Support for this will hopefully be available in the future.
  • The disable-output-escaping attribute. This feature controls how serializing the constructed output document works. However Firefox never serializes the output document and so the attribute isn't really applicable. While we could try to add some heuristics to serialize and reparse just the part of the output document which has disable-output-escaping applied, heuristics often get things wrong and lead to surprising results, hence we've been reluctant to add this so far. Often times stylesheets contain code like <xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>, this is equivalent to putting &#160; in the stylesheet which will work great in all XSLT engines. We do realize that the lack of disable-output-escaping is a problem and we'd like to find a solution for it, however so far we haven't found any good solutions.
  • The <xsl:namespace-alias> element.

If you'd like to help out with any of the above features, help would be greatly appreciated.

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。