From 759b73be8891ed9bacbd6ae96da36ed5b30d52a6 Mon Sep 17 00:00:00 2001
From: Michael Kay A path expression consisting of An expression of the form An expression of the form The results of these multiple evaluations are then combined into a single sequence;
if the result is a set of nodes, the nodes are delivered in document order with
duplicates eliminated. The Similarly, in the expression An expression of the form An expression of the form A The descendants of a node do not include attribute
nodes A /
on its own
is treated as an abbreviation for /.
./PP
(that is, a path expression
+ /PP
(that is, a path expression
with a leading /
) is treated as an abbreviation for
- the expression self::node()/(fn:root(.) treat as document-node())/PP
.
+ the expression self::node()/(fn:root(.) treat as document-node())/PP
.
The effect of this expansion is that for every item J
in the context value V:/
character
+ can be used either as a complete path expression or as the
+ beginning of a longer path expression such as
+ /*
. Also, *
+ is both the multiply operator and a wildcard in path
+ expressions. This can cause parsing difficulties when
+ /
appears on the left-hand side of
+ *
. This is resolved using the /*
and /
+ *
are valid path expressions containing wildcards,
+ but /*5
and / * 5
raise syntax
+ errors. Parentheses must be used when /
is
+ used on the left-hand side of an operator that could be confused with a node test, as in (/) * 5
. Similarly, 4 + / *
+ 5
raises a syntax error, but 4 + (/) * 5
is a valid expression.
+ The expression 4 + /
is also
+ valid, because /
does not occur on the left-hand
+ side of the operator./
+ union /*
, union
is interpreted as an element name
+ rather than an operator. For it to be parsed as an operator,
+ the expression should be written (/)
+ union /*
.//PP
(that is, a path expression
+ //PP
(that is, a path expression
with a leading //
) is treated as an abbreviation for
- the expression self::node()/(fn:root(.) treat as document-node())/descendant-or-self:node()/PP
.
+ the expression self::node()/(fn:root(.) treat as document-node())/descendant-or-self:node()/PP
.
The effect of this expansion is that for every item J
in the context value V://
+ ensure that .//@*
selects all attributes of all descendants.//namespace::*
selects all namespaces of all descendants.//
on its own is not allowed by the grammar.//
on its own is not a valid expression.
Each non-initial occurrence of The Similarly, in the expression If every evaluation of E2 returns a (possibly empty)
- sequence of non-nodes, these sequences are concatenated//
in a path expression is
- expanded as described in /
. This sequence of steps
is then evaluated from left to right. So a path such as
- E1/E2/E3/E4
is evaluated
- as ((E1/E2)/E3)/E4
. The semantics of a path
+ E1/E2/E3/E4
is evaluated
+ as ((E1/E2)/E3)/E4
.
+ The semantics of a path
expression are thus defined by the semantics of the
binary /
operator, which is defined in
/
character
- can be used either as a complete path expression or as the
- beginning of a longer path expression such as
- /*
. Also, *
- is both the multiply operator and a wildcard in path
- expressions. This can cause parsing difficulties when
- /
appears on the left-hand side of
- *
. This is resolved using the /*
and /
- *
are valid path expressions containing wildcards,
- but /*5
and / * 5
raise syntax
- errors. Parentheses must be used when /
is
- used on the left-hand side of an operator that could be confused with a node test, as in (/) * 5
. Similarly, 4 + / *
- 5
raises a syntax error, but 4 + (/) * 5
is a valid expression.
- The expression 4 + /
is also
- valid, because /
does not occur on the left-hand
- side of the operator./
- union /*
, union
is interpreted as an element name
- rather than an operator. For it to be parsed as an operator,
- the expression should be written (/)
- union /*
./
)
@@ -11103,7 +11082,7 @@ return $incrementors[2](4)]]>
code="0019"
/>. Each node in S then serves in turn to provide an inner focus
(the node as the context value, its position in S as the context
- position, the length of S as the context size) for an evaluation
+ position, the length of S
as the context size) for an evaluation
of E2, as described in