Name
<xsl:param>
Defines the name and value of a parameter to be used in
a stylesheet. This element can appear as a top-level element or inside
the <xsl:template> element.
If the <xsl:param> appears as
a top-level element, it is a global parameter, visible to all areas of
the stylesheet. The default value of the parameter can be defined in
one of two ways: specified in the select attribute or defined inside the
<xsl:param> element itself.
[2.0] In XSLT 2.0, <xsl:param> can also appear inside the
new <xsl:function>
element.
Category
Instruction.
Required Attribute
nameDefines the name of this parameter.
Optional Attributes
selectContains an XPath expression that defines the value of this parameter.
- [2.0 – Schema]
as Defines the datatype of this parameter. The datatype can be any of the built-in types or, if you have a schema-aware XSLT processor, a datatype defined in an XML Schema. For example,
as="xs:integer"specifies a parameter that is a single integer, andas="xs:string*"specifies a parameter that is a sequence of zero or more strings. With a schema-aware XSLT processor,as="schema-element(po:purchase-order)"means that the parameter must be a validpo:purchase-order.- [2.0]
required Defines whether this parameter is required. Valid values are
yesandno. If this is a parameter for an<xsl:function>, this attribute must not be defined. For stylesheet and template parameters, the default value is that the parameter is optional (required="no").It is a static error if an
<xsl:param>element ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access