RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
IDOMNode.cloneNode Method

Returns a duplicate of this node.

Pascal
function cloneNode(deep: WordBool): IDOMNode; safecall;
C++
__fastcall IDOMNode cloneNode(WordBool deep);

Use cloneNode to obtain a copy of this node. The cloneNode method returns a copy of this node that has no parent. Any attributes are copied as well, including any attribute nodes that represent default values. 

deep indicates whether the child nodes of this node should be cloned as well. For example, if an element node contains any text, cloneNode only copies then text when deep is true, because the text is contained in a child node of type TEXT_NODE.

Note: When cloning an attribute node directly (as opposed to copying the attributes when cloning an element node), the returned node's specified property is always true, even if this node does not represent a specified attribute.
Note: Cloning an immutable subtree produces a mutable copy, but the children of an entity-reference node are read-only.
Note: DOM implementations may differ in the way they clone nodes of type DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ENTITY_NODE, and NOTATION_NODE.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!