Routines (alphabetical) > Object Classes > File Format Object Classes > IDLffXMLDOMNode::InsertBefore

# IDLffXMLDOMNode::InsertBefore

Syntax | Return Value | Arguments | Keywords | Version History

The IDLffXMLDOMNode::InsertBefore function method inserts a new node into the calling node’s children list at the location before a reference node.

If the reference node is not specified or is a null object reference, the new node is inserted at the end of the list of children.

If the new node is an IDLffXMLDOMDocumentFragment, all of its children are inserted in the same order before the reference node.

If the new node is already in the tree, it is first removed.

The ownership of the IDL object to which the NewChild object reference refers is changed so that it is no longer owned by its previous owner and becomes owned by the calling object. Therefore, destroying the calling object destroys the new child as well.

## Syntax

Result = Obj->[IDLffXMLDOMNode::]InsertBefore( NewChild [, RefChild] )

## Return Value

Returns an object reference to the new child node.

## Arguments

### NewChild

An object reference to an instance of an IDLffXMLDOMNode subclass that refers to the node to insert.

### RefChild

An object reference to an instance of an IDLffXMLDOMNode subclass that refers to the reference node. The new child node is inserted before the reference node. The reference node must be a child of the calling node.

## Keywords

None

## Version History

6.1 | Introduced