DOMElement.SetAttribute

Syntax variant: By name

Syntax:

SetAttribute(<Name>, <Value>)

Parameters:

<Name> (required)

Type: String.
An attribute name.

<Value> (required)

Type: String.
An attribute value.

Syntax variant: By local name and namespace URI

Syntax:

SetAttribute(<NamespaceURI>, <LocalName>, <Value>)

Parameters:

<NamespaceURI> (required)

Type: String.
Attribute namespace URI.

<LocalName> (required)

Type: String.
An attribute local name.

<Value> (required)

Type: String.
An attribute value.

Description:

Sets an attribute value.
If the attribute with the specified name does not exist in the element, it is created and set to the specified value. Otherwise, the attribute value is changed. The attribute value is not parsed while it is set.

Availability:

Server, thick client, external connection, Mobile application (server).

Note:

If the attribute name contains characters incompatible with XML standard of this document, or the node is read-only, an exception is triggered.

    

1C:Enterprise Developer's Community