Sign in Join
FPDoc Onlineexperiment

TDOMDocument.ReplaceChild function

Member of TDOMDocumentpublicIn unit Laz2_DOM

Replaces a child node with another DOM node.

Declaration

pascal
function ReplaceChild(NewChild: TDOMNode; OldChild: TDOMNode): TDOMNode
 ; override

Arguments

NewChild

New DOM node to include in the document.

OldChild

DOM Node replaced with the new DOM node.

Function result

TDOMNode instance detached from the document.

Description

ReplaceChild is an overridden TDOMNode function used to replace the DOM node in OldChild with the DOM node in NewChild.

ReplaceChild ensures that the DocumentElement can be replaced with the specified element node or DTD node in NewChild. When NewNode is not an element or DTD node, the inherited ReplaceChild method is called.

The return value is the TDOMNode instance in OldChild after it has been detached from the document.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.