18. set-attribute
| Chapter 2. Predefined commands |

## 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);

17. script |  | 19. set-doctype