.. _functx_max-depth: ================ functx:max-depth ================ The maximum depth of elements in an XML tree Description ~~~~~~~~~~~ The functx:max-depth function returns the maximum level of elements within a document, as an integer. 1 represents the root, 2 is a child of the root, etc. If $root is a document node, it is counted as a level. Text and other kinds of nodes are not counted as a level. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - root:node() - the root to start from Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:max-depth($in-xml) - 3 * - functx:max-depth($in-xml/author[1]) - 2 See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_depth-of-node`.