Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

cloneNode Method

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

Clones a new node.

var objXMLDOMNode = oXMLDOMNode.cloneNode(deep);

deep

Boolean. Flag that indicates whether to recursively clone all nodes that are descendants of this node. If True, create a clone of the complete tree below this node. If False, clone this node and its attributes only.

Object. Returns the newly created clone node.

S_OK

Value returned if successful.

E_INVALIDARG

Value returned if cloneRoot is Null.

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

The cloned node has the same property values as this node for the following properties: nodeName Property, nodeValue, nodeType, parentNode, ownerDocument, and, if it is an element, attributes. The value of the clone's childNodes depends on the setting of the deep flag parameter.

Aa923265.note(en-us,MSDN.10).gifNote:
If the node is the DOMDocument node, it is safer to clone the document using the save method, as follows. doc.save(doc2);

This method applies to the following objects and interfaces:

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

Community Additions

Show:
© 2015 Microsoft