om.DomNode.insertBefore

Inserts an existing node before the existing node specified.

Syntax

insertBefore(
   new om.DomNode,
   existing om.DomNode )
  1. new is a reference to a new created node.
  2. existing is a reference to a child node existing in the current node.

Usage

The insertBefore() method takes an existing om.DomNode element node and adds it before the child node passed as second parameter, in the list of children of the object node calling the method.

The new node must be created before it is passed as parameter to this method, typically, with om.DomDocument.createElement().

DEFINE parent, other, child om.DomNode
...
LET child = mydoc.createElement("Item")
CALL parent.insertBefore(child, other)