xsl:with-param

Used to define an actual parameter to a template. It may be used within an xsl:call-template, xsl:apply-templates, or xsl:apply-imports element.

Content: sequence-constructor
Permitted parent elements: xsl:apply-templates ; xsl:apply-imports ; xsl:call-template ; xsl:next-match

Attributes

name

eqname

The name of the parameter.

select?

expression

The value of the parameter may be defined either by a select attribute, or by the contents of the xsl:param element, in the same way as for xsl:variable.

as?

sequence-type

tunnel?

boolean

The attribute tunnel="yes" creates a tunnel parameter which is accessible to called templates at any depth, whether or not they are declared in intermediate templates. However, the value is only accessible if tunnel="yes" is also specified on the corresponding xsl:param element.

Details

For an example, see xsl:template.

In XSLT 3.0, xsl:with-param can also appear as a child of xsl:evaluate, to define variables available for use within the dynamically-evaluated XPath expression, and as a child of xsl:next-iteration, to define values of iteration parameters to be used on the next iteration.

Links to W3C specifications

XSLT 2.0 Specification

XSLT 3.0 Specification

See also

xsl:apply-imports

xsl:apply-templates

xsl:call-template

xsl:param