Partager via


appendChild Method (Windows Embedded CE 6.0)

1/6/2010

Appends newChild as the last child of the node.

Script Syntax

var objXMLDOMNode = oXMLDOMNode.appendChild(newChild);

Remarks

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

  • newChild
    Object. Address of the new child node to be appended at the end of the list of children belonging to this node.

Ee503025.collapse(en-US,WinEmbedded.60).gifScript Return Value

Object. Returns the new child node successfully appended to the list.

Ee503025.collapse(en-US,WinEmbedded.60).gifScript Remarks

Note that this is equivalent to calling insertBefore(newChild, null). For more information, see insertBefore Method.

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

HRESULT appendChild(
  IXMLDOMNode* newChild,
  IXMLDOMNode** outNewChild
);

Remarks

Ee503025.collapse(en-US,WinEmbedded.60).gifC/C++ Parameters

  • newChild
    [in] Address of the new child node to be appended to the end of the list of children of this node.
  • outNewChild
    [out, retval] New child node successfully appended to the list. If Null, no object is created.

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

  • S_OK
    Value returned if successful.
  • E_INVALIDARG
    Value returned if newChild is Null.
  • E_FAIL
    Value returned if an error occurs.

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

If newChild has an existing parent, the node is automatically removed from that parent before being inserted into its new location.

A node retains its namespace information even when moved. Moving a node does not create a namespace declaration; declarations are added when retrieving the XML source (through the save or xml) to ensure that all namespaces are properly declared.

When inserting a node tree under another node that has a different owner document, the ownerDocument property for each inserted node is changed to match the owner document of its new parent.

When moving a node tree to another document, the content of all entity reference nodes contained therein is updated to conform to the new document. If the new document does not declare an entity that was moved into it, the entity reference will have no children, and the old content is removed. Existing references to nodes under the entity reference are still valid, but the node whose parent previously was the entity reference now has a null parent.

Note that this is equivalent to calling insertBefore(newChild, null). For more information, see the insertBefore Method.

This method applies to the following objects and interfaces:

IXMLDOMAttribute, IXMLDOMCDATASection, IXMLDOMCharacterData, IXMLDOMComment, DOMDocument, IXMLDOMDocumentFragment, IXMLDOMDocumentType, IXMLDOMElement, IXMLDOMEntity, IXMLDOMEntityReference, IXMLDOMNode, IXMLDOMNotation, IXMLDOMProcessingInstruction, IXMLDOMText, IXTLRuntime

See Also

Reference

XML DOM Methods

Concepts

insertBefore Method
save Method
ownerDocument Property

Other Resources

XML