Export (0) Print
Expand All
XML
Expand Minimize

setAttributeNode Method

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

Sets or updates the supplied attribute node on this element.

var objXMLDOMAttribute = oXMLDOMElement.XMLDOMElement(DOMAttribute);

DOMAttribute

Object that contains the attribute node to be associated with this element.

Object. Returns Null unless the new attribute replaces an existing attribute with the same name, in which case this method returns the previous, replaced attribute node.

HRESULT setAttributeNode(
  IXMLDOMAttribute* DOMAttribute,
  IXMLDOMAttribute** attributeNode
);

DOMAttribute

[in] Attribute node that is to be associated with this element.

attributeNode

[out, retval] Null unless the new attribute replaces an existing attribute with the same name, in which case this method returns the previous, replaced attribute node.

S_OK

Value returned if successful.

E_FAIL

Value returned if an error occurs.

Headermsxml2.h, msxml2.idl
Libraryuuid.lib
Windows Embedded CEWindows CE .NET 4.0 and later

You cannot add an existing attribute to an element until you first remove it from its previous element. Also, you cannot add a namespace-qualified attribute when it uses the same prefix as another attribute with a different namespaceURI Property (IXMLDOMNode)

This method applies to the following objects and interfaces:

IXMLDOMElement.

Other Resources


Community Additions

ADD
Show:
© 2014 Microsoft