Name

f:generate-id — Generate a unique identifier for an element.

Function:
{http://docbook.org/ns/docbook/functions}generate-id#1
Defined in:
modules/functions.xsl, modules/shared.xsl
Used in:
modules/unhandled.xsl, modules/shared.xsl, modules/functions.xsl, modules/index.xsl, modules/programming.xsl, modules/verbatim.xsl, modules/tablehtml.xsl, modules/xlink.xsl, modules/links.xsl, modules/attributes.xsl, modules/annotations.xsl, modules/chunk.xsl
Used by:
f:generate-id(), f:id(), f:href(), f:chunk-filename()

Synopsis

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

Description

This function returns a unique ID for an element. The ID is generated from the names of the ancestors and preceding siblings of the element. This value will be consistent across different transformations as long as the ancestors and preceding siblings remain unchanged.

If there’s an element with a xml:id attribute among the ancestors, the unique identifier is rooted at that element, rather than traversing all the way to the root of the document..