Description
The fn:count function returns the number of items in a sequence, as an xs:integer.
This description is © Copyright 2007, O'Reilly Media. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return Type| Name | Type | Description |
$arg |
item()* |
the sequence of items to count |
| return value |
xs:integer |
Examples| XQuery Example | Results |
|---|
count( (1, 2, 3) )
|
3
|
count($ordDoc//item)
|
6
|
count(
distinct-values($ordDoc//item/@num))
|
4
|
count( (1, 2, 3, () ) )
|
3
|
count( () )
|
0
|
See Also| fn:sum | The sum of values in a sequence |
History |
|