.. _empty: ===== empty ===== Whether a value is the empty sequence Description ~~~~~~~~~~~ The fn:empty function checks whether sequence is empty, meaning that it contains zero items. A sequence is not considered empty just because it only contains a zero-length string, the value 0, or an element with empty content. It is often unnecessary to call the fn:empty function because sequences are automatically converted to their effective boolean value where a boolean value is expected .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:string() - Examples ~~~~~~~~ .. list-table:: :widths: 25 25 50 :header-rows: 1 * - **XPath** - **Results** - **Explanation** * - empty( ('a', 'b', 'c') ) - false - * - empty( () ) - true - * - empty(0) - false - * - empty($in-xml/a) - false - * - empty($in-xml/b) - false - * - empty($in-xml/c) - false - * - empty($in-xml/foo) - true - Or a static error, if static typing is in effect and foo is not an allowed child. .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - empty( ('a', 'b', 'c') ) - false * - empty( () ) - true * - empty(0) - false * - empty($in-xml/a) - false * - empty($in-xml/b) - false * - empty($in-xml/c) - false * - empty($in-xml/foo) - true See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`exists`. * :ref:`functx_if-empty`. * :ref:`functx_if-absent`. * :ref:`functx_all-whitespace`.