Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Clones a new node.
Script Syntax
Copy Code | |
---|---|
var objXMLDOMNode = oXMLDOMNode.cloneNode( deep); |
Remarks
Script Parameters
- 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.
Script Return Value
Object. Returns the newly created clone node.
C/C++ Syntax
Copy Code | |
---|---|
HRESULT cloneNode( VARIANT_BOOL deep, IXMLDOMNode** cloneRoot ); |
Remarks
C/C++ Parameters
- deep
-
[in] 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.
- cloneRoot
-
[out, retval] Newly created clone node.
C/C++ Return Values
- S_OK
-
Value returned if successful.
- E_INVALIDARG
-
Value returned if cloneRootis Null.
Requirements
Header | msxml2.h, msxml2.idl |
Library | uuid.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
General Remarks
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 childNodesdepends on the setting of the deepflag parameter.
Note: |
---|
If the node is the
DOMDocumentnode, it is safer to clone the document using the
savemethod, 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
Concepts
nodeValue PropertynodeType Property
parentNode Property
ownerDocument Property
attributes Property
childNodes Property