6 Named Templates
Named Templates
<
call-template
name=
qname
>
<-- Content: with-param*-->
<
/call-template>
Templates can be invoked by name. An xsl:template
element with a name attribute specifies a named template.
The value of the name attribute is a QName, which is expanded as described
in [Qualified Names]. If an xsl:template element has
a name attribute, it may, but need not, also have a
match attribute. An xsl:call-template
element invokes a template by name; it has a required
name attribute that identifies the template to be
invoked. Unlike xsl:apply-templates,
xsl:call-template does not change the current node or the
current node list.
The match, mode and priority attributes on an
xsl:template element do not affect whether the template
is invoked by an xsl:call-template element. Similarly,
the name attribute on an xsl:template
element does not affect whether the template is invoked by an
xsl:apply-templates element.
It is an error if a stylesheet contains more than one template with
the same name and same Import Precedence.
|