f:id — Returns an ID for the element.

Defined in:
modules/functions.xsl, modules/shared.xsl
Used in:
modules/toc.xsl, modules/blocks.xsl, modules/objects.xsl, modules/footnotes.xsl, modules/links.xsl
Used by:


f:id($node as element()) as xs:string
f:id($node as element()) as xs:string


This function returns the ID of the element. If the element has an xml:id attribute, the value of that attribute is returned. Otherwise, the function constructs a unique ID value for the element.

The simplest way to construct a unique ID is with the f:generate-id() function. However, those values are only unique within the context of a single transformation and tend to vary over time. This can break anchors used in published documents and leads to spurious differences between documents.

The stylesheets generate their own unique IDs with f:generate-id().