XPath Tutorial



XPath Operators


An XPath expression returns either nodes, a Boolean, a string, or a number.



Operator DescriptionExample
|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 toid = 123
!=Not Equal toid != 123
<Less Than price < 100
>Greater Than price > 100
<=Less Than or Equal toprice <= 100
>=Greater Than or Equal to price >= 100
and And level > 1 and level < 10
or Or id = 1 or id = 2