Represent an element or call a function.
The following construct(s) refer to this construct:
An ElementNameOrFunctionCall
consists of a QName that may be
followed by a list of comma-separated expressions encloses in parentheses. If
it only consists of a QName, then it represents an element name. Otherwise it
is a function call.
In case of a function call, each argument is evaluated. The resulting value is converted to the declared type of the corresponding function parameter as described in the section Data Types of the XQuery 4 User Guide. The function is then executed using the converted argument values. The return value is converted to the type declared as the return type of that function.
Compute the number of books published before 2000:
count(for $a in input()/bib/book where $a/@year < 2000 return $a)
The count
function takes a sequence of items, and returns
the number of items in the sequence. Here, the sequence of all
book
elements that satisfy the condition that they
have an attribute year
whose value is smaller
than 2000, is passed as argument to the count
function. The
computed number of sequence items is then returned as an integer value.