Counts the number items in the sequence.
xf:count(item* $item-var) —> xs:unsignedInt
Returns the number of items in a sequence passed into $item-var as an unsignedInt value.
Returns 0 if $item-var is the empty sequence. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.
Invoking count(("a","b","c")) returns the unsigned integer value of 3, as shown in the following example query:
<result>{xf:count(("a","b","c"))}</result>
The preceding query generates the following result:
<result>3</result>
Invoking count(()) returns the unsigned integer value of 0 because () is an empty sequence (contains no elements), as shown in the following example query:
<result>{xf:count(())}</result>
The preceding query generates the following result:
<result>0</result>
W3C count function description.