XPath Tutorial
XPath HOME
XPath Intro
XPath Nodes
XPath Syntax
XPath Axes
XPath Operators
XPath Examples
XPath Summary
References
XPath Functions
Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality
W3Schools Tutorials
W3Schools Forum
Helping W3Schools
|
XPath Operators
An XPath expression returns either a node-set, a string, a
Boolean, or a number.
XPath Operators
Below is a list of the operators that can be used in XPath expressions:
| Operator |
Description |
Example |
Return value |
| | |
Computes two node-sets |
//book | //cd |
Returns a node-set with all book and cd elements |
| + |
Addition |
6 + 4 |
10 |
| - |
Subtraction |
6 - 4 |
2 |
| * |
Multiplication |
6 * 4
|
24 |
| div |
Division |
8 div 4 |
2 |
| = |
Equal |
price=9.80 |
true if price is 9.80
false if price is 9.90 |
| != |
Not equal |
price!=9.80 |
true if price is 9.90
false if price is 9.80 |
| < |
Less than |
price<9.80 |
true if price is 9.00
false if price is 9.80 |
| <= |
Less than or equal to |
price<=9.80 |
true if price is 9.00
false if price is 9.90 |
| > |
Greater than |
price>9.80 |
true if price is 9.90
false if price is 9.80 |
| >= |
Greater than or equal to |
price>=9.80 |
true if price is 9.90
false if price is 9.70 |
| or |
or |
price=9.80 or price=9.70 |
true if price is 9.80
false if price is 9.50 |
| and |
and |
price>9.00 and price<9.90 |
true if price is 9.80
false if price is 8.50 |
| mod |
Modulus (division remainder) |
5 mod 2 |
1 |
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|
|
Jump to: Top of Page
or HOME or
Printer friendly page
W3Schools provides material for training only. We do not warrant the correctness of its contents.
The risk from using it lies entirely with the user.
While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2008 by Refsnes Data. All Rights Reserved.
|
|
|