Sign in Join
FPDoc Onlineexperiment

TDOMDocument.InsertBefore function

Member of TDOMDocumentpublicIn unit Laz2_DOM

Inserts a DOM Node prior to the reference DOM node.

Declaration

pascal
function InsertBefore(NewChild: TDOMNode; RefChild: TDOMNode): TDOMNode
 ; override

Arguments

NewChild

New DOM Node to include in the document.

RefChild

Reference DOM Node that determines the location for the new DOM node.

Function result

DOM Node inserted in the method.

Description

InsertBefore is an overridden method in TDOMDocument used to insert the DOM node specified in NewChild immediately before the node specified in RefChild.

InsertBefore checks the NodeType property in NewChild to ensure that the operation is valid for the node type. An EDOMHierarchyRequest exception is raised for either of the following conditions:

  • NewChild is a DOM Element node and the DocumentElement has already been assigned.
  • NewChild is a DOM DocumentType node and the DocType property has already been assigned.

InsertBefore calls the inherited method using NewChild and RefChild as arguments.

See also

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