NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlElement.SetAttributeNode (XmlAttribute)

Adds the specified XmlAttribute.

[Visual Basic]
Overloads Overridable Public Function SetAttributeNode( _
   ByVal newAttr As XmlAttribute _
) As XmlAttribute
[C#]
public virtual XmlAttribute SetAttributeNode(
   XmlAttribute newAttr
);
[C++]
public: virtual XmlAttribute* SetAttributeNode(
   XmlAttribute* newAttr
);
[JScript]
public function SetAttributeNode(
   newAttr : XmlAttribute
) : XmlAttribute;

Parameters

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

Return Value

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

Exceptions

Exception Type Condition
WRONG_DOCUMENT_ERR The newAttr was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR This node is read-only.
INUSE_ATTRIBUTE_ERR The newAttr is already an attribute of another XmlElement object. You must explicitly clone XmlAttribute nodes to re-use them in other XmlElements.

Remarks

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

See Also

XmlElement Class | XmlElement Members | System.NewXml Namespace | XmlElement.SetAttributeNode Overload List