PrimaryExpr

Basic XQuery primitive.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

PrimaryExpr

graphics/PrimaryExpr.png

Variable Literal ElementNameOrFunctionCall Wildcard KindTest ParenthesizedExpr

Description

A PrimaryExpr is composed of the language primitives of XQuery. These include variables, literals, function calls, and parenthesized expressions.

Variables consist of a "$" prefix character and a variable name, which must be a QName. Literals are divided into string literals and some forms of numeric literals. An ElementNameOrFunctionCall either represents a simple element name, which is a QName or a call of a function defined in Tamino XQuery 4. Wildcard expressions and KindTest are used in the context of path expressions, while an expression that is enclosed in parentheses influences the precedence of the operators.

Examples

  • Some literal expressions

    42
    42.0
    "42"
    42E2

    The first literal denotes the integer value 42, the second literal denotes the decimal value 42.0. The third literal is a string literal that is composed of the characters "4" and "2", while the last literal denotes a value of double precision.

  • Variables are used in FLWOR and FLWU expressions such as the following:

    for $a in input()/bib/book
    where $a/@year >= 2000
    return $a/title