Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
XPath 2.0
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Other operators == Other operators available in XPath 2.0 include the following: {|class="wikitable" !Operators !! Effect |- | {{mono|+, -, *, div, mod, idiv}} ||Arithmetic on numbers, dates, and durations |- | {{mono|1==, !=, <, >, <=, >=}} ||General comparison: compare arbitrary sequences. The result is true if any pair of items, one from each sequence, satisfies the comparison |- | {{mono|eq, ne, lt, gt, le, ge}} ||Value comparison: compare single items |- | {{mono|is}} ||Compare node identity: true if both operands are the same node |- | {{mono|<<, >>}} ||Compare node position, based on document order |- | {{mono|union, intersect, except}} ||Compare sequences of nodes, treating them as sets, returning the set union, intersection, or difference |- | {{mono|and, or}} || boolean conjunction and disjunction. Negation is achieved using the <code>not()</code> function. |- | {{mono|to}} || defines an integer range, for example <code>1 to 10</code> |- | {{mono|instance of}} || determines whether a value is an instance of a given type |- | {{mono|cast as}} || converts a value to a given type |- | {{mono|castable as}} || tests whether a value is convertible to a given type |} Conditional expressions may be written using the syntax {{code|1=if (A) then B else C}}. XPath 2.0 also offers a <code>for</code> expression, which is a small subset of the [[FLWOR]] expression from [[XQuery]]. The expression {{code|2=xquery|1=for $x in X return Y}} evaluates the expression <code>Y</code> for each value in the result of expression <code>X</code> in turn, referring to that value using the variable reference <code>$x</code>.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)