XPath tutoriallogin
XPath tutorial
author:php.cn  update time:2022-04-20 14:10:21

XPath operators



XPath expressions can return node sets, strings, logical values, and numbers.


XPath Operators

The operators that can be used in XPath expressions are listed below:

##-Subtraction6 - 42*Multiplication6 * 424divDivision8 div 42##=If price is 9.80, return true. !=If price is 9.90, then Return true. ##< is less than price<9.80 is less than or equal to if price is 9.00 , then returns true. If price is 9.90, return false. is greater than price>9.80price>=9.80if price is 9.90 , then returns true. If price is 9.70, return false. price=9.80 or price=9.70If price is 9.80, then returns true. If price is 8.50, return false. 1
OperatorDescriptionInstanceReturn value
|Calculate two node sets//book | //cdReturn all node sets that have book and cd elements
+Addition 6 + 410
is equal to price=9.80

If price is 9.90, return false.

is not equal to price!=9.80

If price is 9.80, return false.

Returns true if price is 9.00 . If price is 9.90, return false.

##<=
price<=9.80

##>

Returns true if price is 9.90 . If price is 9.80, return false.

##>=

is greater than or equal to

##or

or

If price is 9.80, then returns true. If price is 9.50, return false. ##and

with

price>9.00 and price<9.90
mod

Calculate the remainder of division

5 mod 2