次の方法で共有


setAttributeNode Method (Windows Embedded CE 6.0)

1/6/2010

Sets or updates the supplied attribute node on this element.

Script Syntax

var objXMLDOMAttribute = oXMLDOMElement.XMLDOMElement(DOMAttribute);

Remarks

Ee503541.collapse(en-US,WinEmbedded.60).gifScript Parameters

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

Ee503541.collapse(en-US,WinEmbedded.60).gifScript 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.

Ee503541.collapse(en-US,WinEmbedded.60).gifC/C++ Syntax

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

Remarks

Ee503541.collapse(en-US,WinEmbedded.60).gifC/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.

Ee503541.collapse(en-US,WinEmbedded.60).gifC/C++ Return Values

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

Ee503541.collapse(en-US,WinEmbedded.60).gifRequirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later

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 Property (IXMLDOMNode)

This method applies to the following objects and interfaces:

IXMLDOMElement.

See Also

Reference

XML DOM Methods

Other Resources