Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
The important change here was adding the
as
attribute to declare the type. It's this that eliminates the need to create the document node. You can retain the use of
In this example above I have substituted
Beginners sometimes try to write this as:
This won't work, because when you get to the end tag of the
See Also
xsl:when
The
Changes in 2.0
None.
Format
test = expression>
Position
Attributes
Name | Value | Meaning |
test mandatory | XPath Expression | The boolean condition to be tested |
Content
A sequence constructor.
Effect
The
Any XPath expression may be evaluated to obtain an effective boolean value. The rules are given in the section for
The
test
expression in a
The conversion to an integer will not be attempted, and cannot therefore cause a failure, if the condition in the first
Usage and Examples
See
See Also
xsl:with-param
The
Changes in 2.0
The
The
as
and
tunnel
attributes have been added.
When used with
Format
name = qname
select? = expression
as? = sequence-type
tunnel? = “yes” | “no”>
Position
Attributes
Name | Value | Meaning |
name mandatory | Lexical QName | The name of the parameter. |
select optional | XPath Expression | The value of the parameter to be supplied to the called template. |
as optional | SequenceType | Defines the type of the value. |
tunnel optional | yes or no | Indicates whether this is a tunnel parameter. |
Content
An optional sequence constructor. If a
select
attribute is present, the
Effect
The
The value of the parameter is established in exactly the same way as for the
select
expression if present, or the contained sequence constructor if not.
Except for tunnel parameters (those where
tunnel=“yes”
is specified), the parameter value is available only to the immediately called template. If the called template has an