XPath Operators
An XPath expression returns either nodes, a Boolean, a string, or a number.
Operator | Description | Example |
---|---|---|
| | Computes multiple node-sets. | /item | /book |
+ | Addition | 5 + 3 |
- | Subraction | 5 - 3 |
* | Multiplication | 5 * 3 |
div | Division | 5 div 3 |
mod | Modulus (division remainder) | 5 mod 3 |
= | Equal to | id = 123 |
!= | Not Equal to | id != 123 |
< | Less Than | price < 100 |
> | Greater Than | price > 100 |
<= | Less Than or Equal to | price <= 100 |
>= | Greater Than or Equal to | price >= 100 |
and | And | level > 1 and level < 10 |
or | Or | id = 1 or id = 2 |