.. _count: ===== count ===== The number of items in a sequence Description ~~~~~~~~~~~ The fn:count function returns the number of items in a sequence, as an xs:integer. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:integer() - the sequence of items to count Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **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 ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`sum`.