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

<xsl:output>

· 52CE 我爱测

The `<xsl:output>` element controls the characteristics of the output document. To function correctly in Netscape, this element, with the method attribute, must be used. As of 7.0, `method="text"` works as expected.

The <xsl:output> element controls the characteristics of the output document. To function correctly in Netscape, this element, with the method attribute, must be used. As of 7.0, method="text" works as expected.

Syntax

<xsl:output
  method="xml" | "html" | "text"
  version=STRING
  encoding=STRING
  omit-xml-declaration="yes" | "no"
  standalone="yes" | "no"
  doctype-public=STRING
  doctype-system=STRING
  cdata-section-elements=LIST-OF-NAMES
  indent="yes" | "no"
  media-type=STRING />

Required Attributes

None.

Optional Attributes

  • method
    • : Specifies output format.
  • version
    • : Specifies the value of the version attribute of the XML or HTML declaration in the output document. This attribute is only used when method="html" or method="xml".
  • encoding
    • : Specifies the value of the encoding attribute in the output document.
  • omit-xml-declaration
    • : Indicates whether or not to include an XML declaration in the output. Acceptable values are yes or no.
  • standalone (Not supported.)
    • : If present, indicates that a standalone declaration should occur in the output document and gives its value. Acceptable values are yes or no.
  • doctype-public
    • : Specifies the value of the PUBLIC attribute of the DOCTYPE declaration in the output document.
  • doctype-system
    • : Specifies the value of the SYSTEM attribute of the DOCTYPE declaration in the output document.
  • cdata-section-elements
    • : Lists elements whose text contents should be written as CDATA sections. Elements should be whitespace separated.
  • indent (Not supported.)
    • : Specifies if the output should be indented to indicate its hierarchic structure.
  • media-type (Not supported.)
    • : Specifies the output document MIME type.

Type

Top-level, must be the child of <xsl:stylesheet> or <xsl:transform>.

Specifications

XSLT, section 16.

Gecko support

Partial support. See comments above.

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

资料来源与适用范围

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

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

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