Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Format
name = qname
select? = expression
as? = sequence-type>
Position
The
Attributes
Name | Value | Meaning |
name mandatory | Lexical QName | The name of the variable. |
select optional | Expression | An expression that is evaluated to give the value of the variable. If omitted, the value is determined from the contents of the |
as optional | SequenceType | Declares the type of the variable. A type error occurs if the value of the expression cannot be converted to this type using the standard type conversions defined below (page 505). In addition, the presence of this attribute on an |
The
SequenceType
construct is described in Chapter 11.
Content
An optional sequence constructor. If a
select
attribute is present, the
Effect
An
The Name of the Variable
The name of the variable is defined by a lexical QName. Normally, this will be a simple name such as
city
or
total-sales
, 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. Two variables,
my:value
and
your:value
, have matching names if the prefixes
my
and
your
refer to the same namespace URI. If the name has no prefix, it has a null namespace URI—it does not use the default namespace URI.