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!

XmlAttributeCollection.SetNamedItem

Adds a XmlNode using its Name property

[Visual Basic]
Overrides Public Function SetNamedItem( _
   ByVal node As XmlNode _
) As XmlNode
[C#]
public override XmlNode SetNamedItem(
   XmlNode node
);
[C++]
public: override XmlNode* SetNamedItem(
   XmlNode* node
);
[JScript]
public override function SetNamedItem(
   node : XmlNode
) : XmlNode;

Parameters

node
A XmlNode to store in this XmlAttributeCollection. The node will later be accessible using the value of the Name property of the node. If a node with that name is already present in the map, it is replaced by the new one.

Return Value

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

Exceptions

Exception Type Condition
WRONG_DOCUMENT_ERR node was created from a different XmlDocument than the one that created this XmlNamedNodeMap.
NO_MODIFICATION_ALLOWED_ERR This XmlNamedNodeMap is readonly.
INUSE_ATTRIBUTE_ERR node is an XmlAttribute that is already an attribute of another XmlElement object. To re-use attributes in other elements, you must clone the XmlAttribute objects you want to re-use.

See Also

XmlAttributeCollection Class | XmlAttributeCollection Members | System.NewXml Namespace