.. _functx_depth-of-node: ==================== functx:depth-of-node ==================== The depth (level) of a node in an XML tree Description ~~~~~~~~~~~ The functx:depth-of-node function returns the level of a node within a document, as an integer. 1 represents the root node, 2 is a child of the root, etc. If $node is a document node, the document node itself counts as the first level. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - node:node() - the node to check Examples ~~~~~~~~ .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:depth-of-node($in-xml) - 1 * - functx:depth-of-node($in-xml/author[1]) - 2 * - functx:depth-of-node($in-xml/author[1]/fName/text()) - 4 See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`functx_max-depth`.