20. set-element-name

set-element-name(name, element?)

Change the name of element element to name name. Parameter name is a string representing an XML qualified name. The default namespace, if any, is taken into account when parsing this qualified name. Parameter element defaults to the context node.

Examples:

set-element-name("li");

set-element-name("html:caption", preceding-sibling::title);

Parameter name may be followed optionally by attributes. When this is the case, the name of element element is changed to specified value and specified attributes are added or replaced to/in element element.

Example:

set-element-name("li style='color: #333;' class='item'");