xsl:template
Syntax
<xsl:template match="pattern" mode="qualified-name" name="qualified-name">
<xsl:param name="qualified-name" select="expression">
...
</xsl:param>
...
</xsl:stylesheet>
Description
Declare a template that contains rules to apply when a specified node is matched. The match attribute associates the template with an XML element. The match attribute can also be used to define a template for a whole branch of the XML document For example, match="/" matches the whole document.
When templates are applied to a node set using the <xsl:apply-templates> instruction, they might be applied in a particular mode; the mode attribute in the <xsl:template> instruction indicates the mode in which a template needs to be applied for the template to be used. If templates are applied in the specified mode, the match attribute is used to determine whether the template can be used with the particular node.
You can pass templates parameters by using the <xsl:with-param> element. To receive a parameter, the template must contain an <xsl:param> element that declares a parameter of that name. These parameters are listed before the body of the template, which is used to process the node and create a result.
match—Applies the template to nodes by specifying a pattern against which nodes are matched.
mode—Indicates the mode in which a template needs to be applied for the template to be used.
name—Calls the template by name.
See all examples listed in Commit Script Examples.
Hide Navigation Pane
Show Navigation Pane
Download
SHA1