Partager via


cloneNode Method

Clones a new node.

var objXMLDOMNode = oXMLDOMNode.cloneNode(deep);

HRESULT cloneNode(
  VARIANT_BOOL deep,
  IXMLDOMNode** cloneRoot
);

General Remarks

The cloned node has the same property values as this node for the following properties: nodeName, 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.

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

See Also

nodeName Property | nodeValue Property | nodeType Property | parentNode Property | ownerDocument Property | attributes Property | childNodes Property

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.