Compartilhar via


setAttributeNode Method (Windows CE 5.0)

Send Feedback

Sets or updates the supplied attribute node on this element.

[Script]

Script Syntax

varobjXMLDOMAttribute=oXMLDOMElement.XMLDOMElement(DOMAttribute);

Script Parameters

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

Script Return Value

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.

[C/C++]

C/C++ Syntax

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

C/C++ Parameters

  • 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.

C/C++ Return Values

  • S_OK
    Value returned if successful.
  • E_FAIL
    Value returned if an error occurs.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.

General Remarks

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.

This method applies to the following objects and interfaces:

IXMLDOMElement.

See Also

namespaceURI Property

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.