diff --git a/specifications/xslt-40/src/element-catalog.xml b/specifications/xslt-40/src/element-catalog.xml
index f0c296999..1bb2d8887 100644
--- a/specifications/xslt-40/src/element-catalog.xml
+++ b/specifications/xslt-40/src/element-catalog.xml
@@ -1187,6 +1187,23 @@
an instruction that returns an arbitrary sequence by evaluating an XPath
- expression:
instructions that returns an arbitrary values by evaluating an XPath
+ expression:
instructions that cause conditional or repeated evaluation of nested @@ -3210,26 +3210,26 @@ as="map(xs:integer, xs:double)" visibility="public"> <xsl:param name="real" as="xs:double"/> <xsl:param name="imaginary" as="xs:double"/> - <xsl:sequence select="{ 0: $real, 1: $imaginary }"/> + <xsl:item select="{ 0: $real, 1: $imaginary }"/> </xsl:function> <xsl:function name="f:real" as="xs:double" visibility="public"> <xsl:param name="complex" as="map(xs:integer, xs:double)"/> - <xsl:sequence select="$complex(0)"/> + <xsl:item select="$complex(0)"/> </xsl:function> <xsl:function name="f:imag" as="xs:double" visibility="public"> <xsl:param name="complex" as="map(xs:integer, xs:double)"/> - <xsl:sequence select="$complex(1)"/> + <xsl:item select="$complex(1)"/> </xsl:function> <xsl:function name="f:add" as="map(xs:integer, xs:double)" visibility="public"> <xsl:param name="x" as="map(xs:integer, xs:double)"/> <xsl:param name="y" as="map(xs:integer, xs:double)"/> - <xsl:sequence select=" + <xsl:item select=" f:complex-number( f:real($x) + f:real($y), f:imag($x) + f:imag($y))"/> @@ -3239,7 +3239,7 @@ as="map(xs:integer, xs:double)" visibility="public"> <xsl:param name="x" as="map(xs:integer, xs:double)"/> <xsl:param name="y" as="map(xs:integer, xs:double)"/> - <xsl:sequence select=" + <xsl:item select=" f:complex-number( f:real($x)*f:real($y) - f:imag($x)*f:imag($y), f:real($x)*f:imag($y) + f:imag($x)*f:real($y))"/> @@ -5945,7 +5945,7 @@ as="xs:string?" visibility="public"> <xsl:param name="line" as="xs:string" /> - <xsl:sequence select="normalize-space($line)" /> + <xsl:item select="normalize-space($line)" /> </xsl:function>
Because the function is declared public
, it can be overridden by a
@@ -6093,7 +6093,7 @@ there is no need to make it needlessly implausible.
As can be seen, the function does nothing but return its input; its only @@ -6191,7 +6191,7 @@ there is no need to make it needlessly implausible.
--> <xsl:param name="line" as="xs:string" /> <xsl:variable name="norm-line" select="normalize-space(xsl:original($line))" /> - <xsl:sequence select="if (string-length($norm-line) > 0) + <xsl:item select="if (string-length($norm-line) > 0) then $norm-line else ()" /> </xsl:function> @@ -11079,7 +11079,7 @@ andversion="1.0"
otherwise.
Note how the item type declaration has implicitly declared a constructor function
@@ -11645,13 +11645,15 @@ and version="1.0"
otherwise.
version="1.0"
otherwise.
or insert separators between adjacent items. This means it is often inappropriate
to use The result of a function, or the value of a variable, may contain nodes
(such as elements, attributes, and text nodes) that are not attached to any parent node
@@ -11730,7 +11732,9 @@ and version="1.0"
otherwise.
version="1.0"
otherwise.
sequence of five text nodes, which are concatenated without space
separation.
It is important to be aware of the distinction between
- select
expression unchanged, and select
expression unchanged (except for type coercion), and
version="1.0"
otherwise.
The value of the following variable is a sequence of integers (2, 4, 6):
The value of the following variable is a sequence of parentless attribute
@@ -19660,7 +19664,7 @@ and version="1.0"
otherwise.
version="1.0"
otherwise.
version="1.0"
otherwise.
The
The items comprising the result sequence are evaluated either using
- the select
attribute, or using the contained select
attribute, then it select
attribute and no contained
- For the elements select
attribute is present
- and the instruction has children other than
Any contained
The following code:
-The as
attribute is constrained to be an item type rather than
+ a sequence type, and the default value is item()
.
The result item is evaluated either using
+ the select
attribute, or using the contained select
attribute, then it select
attribute
+ or a non-empty
Any contained
The
The following function:
+raises a type error $in
is an empty sequence,
+ because the result of
as
attribute to define
+ the expected type of the result.
+ The
The items comprising the result sequence are evaluated either using
+ the select
attribute, or using the contained select
attribute, then it select
attribute and no contained
If an as
attribute is present, the result of this evaluation is converted to the specified
+ sequence type by applying the
+ For the elements select
attribute is present
+ and the instruction has children other than
Any contained
The following code:
+produces the output: 37
-
xsl:for-each
to Construct a Sequence
- The following code constructs a sequence containing the value of the
- @price
attribute for selected elements (which we assume to be
- typed as xs:decimal
), or a computed price for those elements that
- have no @price
attribute. It then returns the average price:
produces the output: 37
+
xsl:for-each
to Construct a Sequence
+ The following code constructs a sequence containing the value of the
+ @price
attribute for selected elements (which we assume to be
+ typed as xs:decimal
), or a computed price for those elements that
+ have no @price
attribute. It then returns the average price:
Note that the existing @price
attributes could equally have been
- added to the $prices
sequence using xs:decimal
. Using xs:decimal
atomic value to the result sequence, is a more direct
- way of achieving the same result.
This example could alternatively be solved at the XPath level:
-The apparently redundant +
operator is there to atomize the attribute
- value: the expression on the right hand side of the /
operator must
- not return a sequence containing both nodes and
- non-nodes (atomic values or function items).
The main use case for allowing
It can also be used to limit the scope of local variables or of standard
- attributes such as [xsl:]default-collation
.
Note that the existing @price
attributes could equally have been
+ added to the $prices
sequence using xs:decimal
. Using xs:decimal
atomic value to the result sequence, is a more direct
+ way of achieving the same result.
This example could alternatively be solved at the XPath level:
+The apparently redundant +
operator is there to atomize the attribute
+ value: the expression on the right hand side of the /
operator must
+ not return a sequence containing both nodes and
+ non-nodes (atomic values or function items).
The main use case for allowing
It can also be used to limit the scope of local variables or of standard
+ attributes such as [xsl:]default-collation
, and to define a scope
+ for
The content of the
The
The emp
child, with that child as context item and in a
select
expression is
The result of the trivial sequence constructor contained in the