Javatpoint Logo
Javatpoint Logo

XPath Comparison Operators

A list of comparison operators used in XPath:

Index Operator Description
1) = It specifies equals to
2) != It specifies not equals to
3) < It specifies less than
4) > It specifies greater than
5) <= It specifies less than or equals to
6) >= It specifies greater than or equals to

XPath Comparison Operator Example

Let's take an example to demonstrate the usage of comparison operator. Here, we create a table of element with its attribute id and its child <firstname>,<lastname> <nickname> and <salary> by iterating over each employee. It checks salary to be greater than (>) 25000 and then prints the detail.




XPATH Comparison operators 1

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA