Precedence of Query Operators

The precedence of query operators varies for XPath 1.0 and XPath 2.0, as shown in the following tables. In these tables, operators are listed in order of precedence, with highest precedence being first; operators in a given row have the same precedence.

Operation Type
XPath Operators
Grouping
( )
               

            
Filter
[ ]
               

            
Unary minus

              - 
               

            
Multiplication
*, div, mod
               

            
Addition
+, -
               

            
Relational (Comparison)
= != < <= > >=
               

            
Union
|
               

            
Negation
not
               

            
Conjunction
and
               

            
Disjunction
or
               

            
Table 82. Query Operator Precedence - XPath 1.0

Operation Type
XPath Operators
Sequence separator
,
               

            
Conjunction
and
               

            
Type matching

              instance of
               

            
Assertion
treat
               

            
Conversion test
castable
               

            
Conversion
cast
               

            
Relational (Comparison)
eg, ne, lt, le, gt, ge, =, !=, <, <=, >, >=, 
is, <<, >>
               

            
Range
to
               

            
Addition
+, -
               

            
Multiplication
*, div, idiv, mod
               

            
Unary
unary -, unary +
               

            
Union
union, |
               

            
Select set
intersect, except
               

            
Navigation
/, //
               

            
Filter
[ ]
               

            
Table 83. Query Operator Precedence - XPath 2.0

XQuery API for Java (XQJ)

DataDirect XQuery is an embeddable software product based on the XQuery and XQJ standards that enables Java developers to access both relational and XML data sources using a single XQuery query. Runs on Oracle, SQL Server, DB2, and more!

XML Developers' Bill of Rights

Stylus Studio's pledge to fight for the rights of XML Developers, providing the most productive, innovative and value-priced XML development tools.

Join Us: Apply for a Job at Stylus Studio Today

Join our team of XML professionals and help us in our mission to create the most productive XML tools and components on the planet. Apply today!

Metals, Mining & Crude-Oil Production

It can be very dark and dreary in a mine. That's why metal, mining & crude-oil production are using Stylus Studio as their light when it comes to data integration. See which of these top companies are using Stylus Studio to show them the way to XML!

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.