ForClause

Bind variables by evaluating expressions.


Syntax

ForClause

graphics/ForClause.png

Variable Variable Expr

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.

Example

See FLWORExpr for examples.

Related Syntax Constructs

The following construct(s) refer to this construct:

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

LetClause WhereClause