System.Xml.XmlElement.SetAttributeNode Method

Adds the specified System.Xml.XmlAttribute.

Syntax

public virtual XmlAttribute SetAttributeNode (XmlAttribute newAttr)

Parameters

newAttr
The XmlAttribute node to add to the attribute collection for this element.

Returns

If the attribute replaces an existing attribute with the same name, the old XmlAttribute is returned; otherwise, null is returned.

Remarks

If an attribute with that name is already present in the element, it is replaced by the new one.

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0