XQuery Resources >
This tutorial describes the use of different kinds of XQuery expressions by example. All the queries in this tutorial are based on the sample documents found
A Quick introduction to common XQuery expressions
XQuery is a functional language with an
as the central expression. Each query is built from expressions which can be nested to arbitrary depth. Here is a quick introduction by example to the most common types of expressions in the XQuery language.
The FLWOR expression is one of the most versatile expressions in the XQuery language. Users familiar with SQL will notice that the construction of FLWOR expressions is similar to select statements. This section introduces the FLWOR expressions by going from simple to moderately complex FLWR expressions.
XQuery provides facilities to build output xml fragments with arbitrarily complex structures using element/attribute/text node/PI/comment constructors. This section provides examples of two types of constructors, direct (using an XML notation) and computed (a notation that allows element/attribute names to be computed), for element and attribute construction.
XQuery built-in functions
The XQuery specification includes a large library of built-in functions. This section shows some of these functions.
Apart from built-in functions, user can also define their own functions that can be invoked in the same way as the built-in functions. The examples in this section demonstrate how this can be done.
This section demonstrates the use of logical expressions through examples of if-then-else expressions, where clauses in FLWR expressions, quantified expressions etc.
News & Events