Returns the number of items in a sequence.
fn:count
( $arg
as item()*
xs:integer
The function returns the number of items in the value of $arg
.
let $seq1 := ($item1, $item2)
let $seq2 := (98.5, 98.3, 98.9)
let $seq3 := ()
The expression fn:count($seq1)
returns 2
.
The expression fn:count($seq3)
returns 0
.
The expression fn:count($seq2)
returns 3
.
The expression fn:count($seq2[. > 100])
returns 0
.
The expression fn:count([])
returns 1
.
The expression fn:count([1,2,3])
returns 1
.
Returns 0 if $arg
is the empty sequence.