HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
XPath expressions can return a node set, string, Boolean values, and numbers.
The following lists are available in the XPath expression operators:
Operators | description | Examples | return value |
---|---|---|---|
| | Two sets compute nodes | // Book | // cd | Returns all elements has a book and cd node set |
+ | addition | 6 + 4 | 10 |
- | Subtraction | 6--4 | 2 |
* | multiplication | 6 * 4 | twenty four |
div | division | 8 div 4 | 2 |
= | equal | price = 9.80 | If the price is 9.80, it returns true. If the price is 9.90, it returns false. |
! = | not equal to | price! = 9.80 | If the price is 9.90, it returns true. If the price is 9.80, it returns false. |
< | Less than | price <9.80 | If the price is 9.00, it returns true. If the price is 9.90, it returns false. |
<= | less than or equal to | price <= 9.80 | If the price is 9.00, it returns true. If the price is 9.90, it returns false. |
> | more than the | price> 9.80 | If the price is 9.90, it returns true. If the price is 9.80, it returns false. |
> = | greater than or equal to | price> = 9.80 | If the price is 9.90, it returns true. If the price is 9.70, it returns false. |
or | or | price = 9.80 or price = 9.70 | If the price is 9.80, it returns true. If the price is 9.50, it returns false. |
and | versus | price> 9.00 and price <9.90 | If the price is 9.80, it returns true. If the price is 8.50, it returns false. |
mod | Calculated remainder of the division | 5 mod 2 | 1 |