EnclosedExpr

Evaluate a sequence of expressions.


Syntax

EnclosedExpr

graphics/EnclosedExpr.png

ExprSequence

Description

An EnclosedExpr is part of constructors for elements and attributes and consists of a sequence of one or more expressions that is enclosed by braces. The expressions are evaluated and the EnclosedExpr is replaced with the result of the evaluation.

Example

  • Reformat book entries:

    for $a in input()/bib/book
    let $authors :=
        for    $I in $a/author
        return <author>{ $i/last/text() }, { $i/first/text() }</author>
    return
    <mybook published="{ $a/@year }">
      { $authors }
      { $a/title }
    </mybook>

    This example uses five enclosed expressions that are evaluated to three different kinds of nodes: two text nodes that are used in the construction of the local author elements bound to $authors, an attribute node (year), a single element node (title), and one or more element nodes by evaluating $authors.

Related Syntax Construct

The following construct(s) refer to this construct:

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

ElementConstructor