May 28, 2021 XPath
XPath expressions return node sets, strings, logical values, and numbers.
The operators available in the XPath expression are listed below:
Operator | Describe | Instance | Returns a value |
---|---|---|---|
| | Calculates the set of two nodes | book | Cd | Returns all node sets that have book and cd elements |
+ | Addition | 6 + 4 | 10 |
- | Subtraction | 6 - 4 | 2 |
* | Multiplication | 6 * 4 | 24 |
Div | Division | 8 div 4 | 2 |
= | Equals | price=9.80 |
If price is 9.80, true is returned. If price is 9.90, false is returned. |
!= | Not equal to | price!=9.80 |
If price is 9.90, true is returned. If price is 9.80, false is returned. |
< | Less than | price<9.80 |
If price is 9.00, true is returned. If price is 9.90, false is returned. |
<= | Less than or equal to | price<=9.80 |
If price is 9.00, true is returned. If price is 9.90, false is returned. |
> | Greater than | price>9.80 |
If price is 9.90, true is returned. If price is 9.80, false is returned. |
>= | Is greater than or equal to | price>=9.80 |
If price is 9.90, true is returned. If price is 9.70, false is returned. |
or | Or | price=9.80 or price=9.70 |
If price is 9.80, true is returned. If price is 9.50, false is returned. |
and | And | price>9.00 and price<9.90 |
If price is 9.80, true is returned. If price is 8.50, false is returned. |
mod | Calculate the remaining part of the divide | 5 mod 2 | 1 |