Skip to content

SetAttribute

Sets an attribute on current node to specified value.

1
myXml.SetAttribute(attributeName: string, attributeValue: string):void

Parameters

string attributeName
    Qualified name of attribute.

string attributeValue
    Value of attribute.

Remarks

If attribute does not exist, it is created automatically.
This method uses empty namespace for attribute names. If you need to set attribute with a namespace please refer to SetAttributeNS method.

Usage

1
$Xml.SetAttribute('Name', 'John');