[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Laz2_DOM' (#lazutils)

TDOMDocumentFragment.CloneNode

Creates a copy of the document fragment with optional recursion into child nodes.

Declaration

Source position: laz2_dom.pas line 463

public function TDOMDocumentFragment.CloneNode(

  deep: Boolean;

  ACloneOwner: TDOMDocument

):TDOMNode; override; overload;

Arguments

deep

  

Indicates if child nodes are included in the cloned document fragment.

ACloneOwner

  

Document used as the owner of the cloned document fragment.

Function result

The new copy of the document fragment.

Description

CloneNode is a method used to create a document fragment with the content specified in ACloneOwner, the OwnerDocument for the clone. CloneNode implements the method defined for the Node interface in the DOM Level 2 specification.

CloneNode creates a new TDOMNode instance that is a duplicate of the document fragment node by calling the CreateDocumentFragment method in ACloneOwner. This causes ACloneOwner to be assigned as the OwnerDocument for the new node. The new node does not have a ParentNode.

The deep argument indicates if the child nodes in ACloneOwner are also duplicated in the method. When deep is True, the CloneChildren method is called to duplicate the child nodes (recursively). Cloning a DOM Element node using deep recursion also copies its attribute names and values. Set deep to False to limit the copy to the immediate node and its Attributes.

The return value contains a TDOMNode instance with the duplicated content for the node in ACloneOwner.

See also

TDOMDocument.CreateDocumentFragment

  

Creates a new DOM Document Fragment.

TDOMNode_WithChildren.CloneChildren

  

Makes a copy of child nodes in the specified DOM node.

TDOMNode.CloneNode

  

Makes a copy of the DOM node.

TDOMNode.OwnerDocument

  

DOM Document that created the DOM node.


Version 4.0 Generated 2025-05-03 Home