.. _normalize-space: =============== normalize-space =============== Normalizes whitespace Description ~~~~~~~~~~~ The fn:normalize-space function collapses whitespace in a string. Specifically, it performs three steps: 1. Replaces each carriage return (#xD), line feed (#xA), and tab (#x9) character with a single space (#x20) 2. Collapses all consecutive spaces into a single space 3. Removes all leading and trailing spaces .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - arg:string() - Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - normalize-space('query') - query * - normalize-space(' query ') - query * - normalize-space('xml query') - xml query * - normalize-space('xml query') - xml query * - normalize-space('xml query') - xml query * - normalize-space('') - zero-length string * - normalize-space(' ') - zero-length string * - normalize-space(()) - zero-length string * - normalize-space( query ) - query See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_trim`. * :ref:`functx_left-trim`. * :ref:`functx_right-trim`.