Home >Online Product Documentation >Table of Contents >Precedence of Query Operators
Precedence of Query Operators
The precedence of query operators varies for XPath 1.0 and XPath 2.0, as shown in the following tables. In these tables, operators are listed in order of precedence, with highest precedence being first; operators in a given row have the same precedence.
Table 92. Query Operator Precedence - XPath 1.0
Operation Type
|
XPath Operators
|
---|
Grouping
|
( )
|
Filter
|
[ ]
|
Unary minus
|
-
|
Multiplication
|
*, div, mod
|
Addition
|
+, -
|
Relational (Comparison)
|
= != < <= > >=
|
Union
|
|
|
Negation
|
not
|
Conjunction
|
and
|
Disjunction
|
or
|
Table 93. Query Operator Precedence - XPath 2.0
Operation Type
|
XPath Operators
|
---|
Sequence separator
|
,
|
Conjunction
|
and
|
Type matching
|
instance of
|
Assertion
|
treat
|
Conversion test
|
castable
|
Conversion
|
cast
|
Relational (Comparison)
|
eg, ne, lt, le, gt, ge, =, !=, <, <=, >, >=, is, <<, >>
|
Range
|
to
|
Addition
|
+, -
|
Multiplication
|
*, div, idiv, mod
|
Unary
|
unary -, unary +
|
Union
|
union, |
|
Select set
|
intersect, except
|
Navigation
|
/, //
|
Filter
|
[ ]
|