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

<xsl:template>

· 52CE 我爱测

The `<xsl:template>` element defines an output producing template. This element must have either the match attribute or the name attribute set.

The <xsl:template> element defines an output producing template. This element must have either the match attribute or the name attribute set.

Syntax

<xsl:template
  match=PATTERN
  name=NAME
  mode=NAME
  priority=NUMBER>
  <xsl:param> [optional]
  TEMPLATE
</xsl:template>

Required Attributes

None.

Optional Attributes

  • match
    • : Specifies a pattern that determines the elements for which this template should be used. It is a required attribute if there is no name attribute.
  • name
    • : Specifies a name for this template, by which it can be invoked through the <xsl:call-template> element.
  • mode
    • : Specifies a particular mode for this template, which can be matched by an attribute of the <xsl:apply-templates> element. This is useful for processing the same information in multiple ways.
  • priority
    • : Specifies a numeric priority for this template. This can be any number other than Infinity. The processor uses this number when more than one template matches the same node.

Type

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

Specifications

XSLT, section 5.3.

Gecko support

Supported.

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

资料来源与适用范围

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

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

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