Adds a new attribute to the specified element.
If an attribute with that name is already present in the element,
its value is changed to be that of the value
parameter.
This function is always guaranteed to work only with
custom elements, which are created using
CustomElement()
function.
The ordinary DSM (Data Source Model) elements that are connected to the external data source may not allow adding new attributes or changing the attribute values. That's because such attributes may be just virtual things maintained only by the DSM Type Driver via the calls to some external API. In such a case, using this function will lead to a DSM exception!
element
If not specified, the generator context element is assumed by default, which is the same as the call:
setAttr(contextElement, attrName, value)
attrName
value
null
,
if the element had no attribute with the specified name.
getAttrValue(), hasAttr(), removeAttr(), CustomElement()