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

TDOMElement.CloneNode

Creates a DOM node that is a copy of the DOM Element.

Declaration

Source position: laz2_dom.pas line 632

public function TDOMElement.CloneNode(

  deep: Boolean;

  ACloneOwner: TDOMDocument

):TDOMNode; override; overload;

Arguments

deep

  

Indicates if the entire DOM sub-tree is copied for the DOM Element.

ACloneOwner

  

DOM Document that owns the new Node(s) created in the method.

Function result

DOM Node created in the method.

Description

CloneNode is an overridden TDOMNode function in TDOMElement. It re-implements the method from the ancestor class to create a cloned copy of the DOM Element and its Attributes in the DOM Document specified in the ACloneOwner argument.

The cloning mechanism differs depending on whether ACloneOwner and OwnerDocument are the same TDOMDocument instance. Essentially, namespace information in the NSI property is reused when the document instances are the same, and only default attributes are cloned when the documents differ.

When deep is set to True, the CloneChildren method is called to recursively copy the ChildNodes for the Element.

See also

TDOMNode_WithChildren.CloneChildren

  

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

TDOMDocument.CreateElement

  

Creates an element in the document with the specified tag name.

TDOMDocument.CreateElementNS

  

Creates a new DOM Element with the specified Namespace URI.

TDOMNode.Attributes

  

Contains Attribute for the DOM Node.

TDOMNode_NS.NSI

  

Provides access to Namespace information for the DOM node.

TDOMNode.CloneNode

  

Makes a copy of the DOM node.

TDOMNode.ChildNodes

  

Provides access to the list of Child nodes for the current node.

TDOMNode.OwnerDocument

  

DOM Document that created the DOM node.


Version 3.2 Generated 2024-02-25 Home