.. _functx_id-from-element: ====================== functx:id-from-element ====================== Gets the ID of an XML element Description ~~~~~~~~~~~ The functx:id-from-element function takes the $element element and returns its attribute (there can only be one) that is of type xs:ID. If no such attribute exists, or if the argument is the empty sequence, the function returns the empty sequence. The attribute must have been declared to be of type xs:ID in a schema, and validated by that schema, for this function to return it. .. list-table:: :widths: 40 60 :header-rows: 1 * - **Parameters** - **Description** * - element:element() - the element Examples ~~~~~~~~ .. list-table:: :widths: 25 25 50 :header-rows: 1 * - **XPath** - **Results** - **Explanation** * - functx:id-from-element($book/book/section[1]) - preface - Assumes that the attribute id of $element is declared to be of type xs:ID. .. list-table:: :widths: 50 50 :header-rows: 1 * - **XPath** - **Results** * - functx:id-from-element($book/book/section[1]) - preface See Also ~~~~~~~~ .. toctree:: :titlesonly: :glob: * :ref:`id`. * :ref:`idref`.