XML technologies / XPath / XPath 2.0: language reference / XPath expressions: operators and keywords / Precedence of XPath operators
(Excerpt from "XSLT 2.0 & XPath 2.0" by Frank Bongers, chapter 4.)
Operators have a fixed natural evaluation order, called operator precedence. Parentheses around subexpressions and the operators combining them override this order. A parenthesized expression is evaluated first, regardless of the precedence of operators linking it to the rest of the expression.
The following table lists XPath operators and keywords used to combine or mark subexpressions, from top to bottom in decreasing precedence.
Operators/symbols | Meaning |
|---|---|
| Predicates in path expressions |
| Path operators (path expressions) |
| Grouping subexpressions |
| Sequence difference and intersection |
| Sequence union |
| Unary minus |
| Multiplicative operators |
| Additive operators |
| Range operator |
| Comparison operators |
| Dynamic type conversion |
| Testing whether type conversion is possible |
| Static type assertion |
| Type test |
| Logical AND |
| Logical OR |
| Condition |
| Quantified operators |
| Iteration over an input sequence |
| Sequence concatenation |
| Comment (start, end) |
Table: operators and operator keywords in XPath 2.0.
Operator keywords must be written in lowercase as shown above. Operators consisting of two tokens (cast as, treat as, etc.) count as one operator and must be used in this form.
Copyright © Galileo Press, Bonn 2008
You may print the online version for private use.
Otherwise, this chapter from "XSLT 2.0 & XPath 2.0 ― Das umfassende Handbuch" is subject to the same terms as the bound edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, storage and processing in electronic systems.
Galileo Press, Rheinwerkallee 4, 53227 Bonn