Creates a new node that is an exact clone of this node.
objXMLDOMNode = oXMLDOMNode.cloneNode(deep)
Object. Returns the newly created clone node.
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 collection depends on the setting of the deep flag parameter.
The following example clones a node, and then appends it as a child of the top-level node:
Dim xmlDoc Dim root Dim currNode Dim MyNewNode Set xmlDoc = CreateObject("Msxml2.DOMDocument") xmlDoc.async = False xmlDoc.load("c:\books.xml") Set root = xmldoc.documentElement Set currNode = root.childNodes.item(2) Set MyNewNode = currNode.cloneNode(true) root.appendChild (MyNewNode) MsgBox xmlDoc.xml
Applies To: XMLDOMAttribute Object | XMLDOMCDATASection Object | XMLDOMCharacterData Object | XMLDOMComment Object | DOMDocument Object | XMLDOMDocumentFragment Object Object | XMLDOMDocumentType Object | XMLDOMElement Object | XMLDOMEntity Object | XMLDOMEntityReference Object | XMLDOMNode Object | XMLDOMNotation Object | XMLDOMProcessingInstruction Object | XMLDOMText Object | XTLRuntime Object