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 |

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file, Excel 2007, XBRL, or Web services data.
Then it transforms data instantly or auto-generates royalty-free data integration code for recurrent conversions.
New features in Version 2010!
Download a free, fully functional 30-day trial to experience the following features:
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
Download a fully-functional trial today!
|
|
|
|