fn:count

Return number of items in the argument's value.

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:count(item* $sequence) => unsignedInt

Description

This aggregate function returns the number of items in the value of $sequence. If $sequence is the empty sequence, the function returns zero.

Argument

$sequence

item value

Example

  • Count all comment nodes in the current collection:

    count(input()//comment())