The stm:append-attr operation is used to append an attribute to an element located by an xpath.
The select parameter is required, and is the relative xpath to an attribute in the document fragment enclosed by
the stm:append-attr element. If the target attribute already
exists an exception is thrown, you must use stm:delete first to remove the original attribute and then append the new one.
If the xpath value returns multiple targets the attribute is appended to all.
Note: STM rigourously enforces a one-to-many
assignment model. That is, there is a single operation object, in this case the attribute, and one or multiple targets, here this is the
element to which the attribute is appended. This ensures that the language is kept as simple and as comprehensible as possible. Unfortunately attribute
assignment is the exception case where a many-to-one model may have been more appropriate. Future versions
of the language may support many-to-many.
Deprecated stm:append-attr has been deprecated. stm:append now supports attributes and should be used instead.