Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
The Default Value of the Parameter
In the case of stylesheet parameters and template parameters, if no value for the parameter is supplied by the caller, a default value is used. The default value of the parameter may be given either by the XPath expression in the
select
attribute, or by the contents of the contained sequence constructor. If there is a
select
attribute, the
The value is calculated in exactly the same way as the value of a variable in
If there is no
select
attribute and the sequence constructor is empty, the default value of the parameter is a zero-length string, unless there is an
as
attribute, in which case the default value is an empty sequence. If the type given in the
as
attribute does not allow an empty sequence, then the parameter is mandatory.
If the
required
attribute has the value
yes
, then the parameter is mandatory. In this case, it makes no sense to supply a default value, so the
select
attribute must be omitted and the element must be empty. Failing to supply a value for a mandatory parameter is a compile-time error in the case of
The Name of the Parameter
The name of the parameter is defined by the QName given in the
name
attribute. Normally, this will be a simple name (such as
num
or
list-of-names
), but it may be a name qualified with a prefix; for example
my:value
. If it has a prefix, the prefix must correspond to a namespace that is in scope at that point in the stylesheet. As usual it is the namespace URI rather than the prefix that matters, so two variables
my:value
and
your:value
have the same name if the prefixes
my
and
your