.. _exactly-one: =========== exactly-one =========== Returns a sequence if it contains exactly one item, otherwise errors Description ~~~~~~~~~~~ The fn:exactly-one function returns $arg if it contains one and only one item. Otherwise, the error FORG0005 is raised. This function is useful when static typing is in effect, to avoid apparent static type errors. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:item() - Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - exactly-one( () ) - Error FORG0005 * - exactly-one('a') - a * - exactly-one( ('a', 'b') ) - Error FORG0005 See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`one-or-more`. * :ref:`zero-or-one`.