xml.DomDocument.insertBeforeDocumentNode

Inserts a child DomNode object before another child DomNode for this DomDocument object.

Syntax

insertBeforeDocumentNode(
   node xml.DomNode,
   ref xml.DomNode )
  1. node is the node to insert.
  2. ref is the reference node (the node before which the new node must be inserted).

Usage

Inserts a child DomNode object before another child DomNode for this DomDocument object; node is the node to insert, ref is the reference node (the node before which the new node must be inserted).

Only Text nodes, Processing Instruction nodes, Document Fragment nodes, one Element node and one Document Type node allowed.

In case of error, the method throws an exception and sets the STATUS variable with the appropriate error number.