Functions

This document describes the functions available in X-Query. Many of them are defined in XPath with the same syntax and semantics. Please refer to the XPath specification for a more detailed description. Functions that are not present in XPath are marked with an asterisk. Some of the functions that are present in XPath are not implemented in X-Query, but you can extend the functionality of X-Query by writing server extensions implementing the desired function. These extensions can then be registered within the database server so that they are available for all further queries.

Category Function Short Description
Type conversion boolean() convert argument to a Boolean value
number() convert argument to a number
string() convert argument to a string
Arithmetic functions ceiling() return the smallest integer that is greater than or equal to the argument's numeric value
floor() return the largest integer that is less than or equal to the argument's numeric value
round() return the integer that is closest to the argument's numeric value
String functions starts-with() test whether one string starts with another string
Aggregation avg() * return the average value of a set of numeric values that the argument's node set contain
count() return the number of nodes present in the argument's node set
min() * return the smallest value of a set of numeric values that the argument's node set contain
max() * return the largest value of a set of numeric values that the argument's node set contain
sum() calculate the total of a set of numeric values that the argument's node set contain
Node Names name() return a qualified name representing the name of a node
Boolean functions false() return the Boolean value "false"
not() return the negated value of its argument
true() return the Boolean value "true"
Context information last() return the position number of the last node in the list
position() return the position number of the context node
Analysis ino:explain() * return query execution plan