Tamino XML Server Version 9.7
 —  XQuery 4 Reference Guide  —

ForClause

Bind variables by evaluating expressions.


Syntax

ForClause

graphics/ForClause.png

Variable Variable Expr

Top of page

Description

A ForClause is part of FLWOR and FLWU expressions and contains one or more variables that will be related to the expression that follows. The for clause creates tuples from the Cartesian product that is computed from the sequence of values which are the result of evaluating the expression. The return clause will be invoked once for each generated tuple that is retained after passing the optional where clause.

To each bound variable you can associate a positional variable that is bound at the same time. It is preceded by the keyword at and is always of the implied type xs:integer. The positional variable represents the ordinal position of the items in the binding sequence over which the variable iterates, starting at 1.

Top of page

Example

See FLWORExpr for examples.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:

This construct is also related to the following construct(s):

LetClause WhereClause

Top of page