18. set-attribute

set-attribute(name, value, element?)

In specified element, set attribute having specified name to specified value. Parameter name is a string representing an XML qualified name. Parameter element defaults to the context node.

Examples:

set-attribute("class", "note");

set-attribute("xml:id", generate-id());

set-attribute("g:id", "numbered", $listItem);