RangeExpr

Construct a sequence of consecutive integers.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

RangeExpr

graphics/RangeExpr.png

Expr Expr

Description

A RangeExpr is used to construct a sequence of consecutive integers. Each of the two operand expressions is expected to be of type xs:integer. If either operand is an empty sequence, or if the first integer operand is larger than the second, the result of the range expression is an empty sequence. Otherwise, the result is a sequence beginning with the first integer operand and all consecutive integers including the second integer operand.

Examples

  • This range expression is used as one operand in constructing a sequence. The result is the sequence (42, 8, 9, 10, 11).

    (42, 8 to 11)
  • This range expression is evaluated to a sequence with the single integer value 7:

    7 to 7