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.
Parameters |
Description |
---|---|
element:element() |
the element |
Examples
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. |
XPath |
Results |
---|---|
functx:id-from-element($book/book/section[1]) |
preface |