### Method

# Aravis DomNode insert_before

#### Declaration [src]

    ArvDomNode*
    arv_dom_node_insert_before (
      ArvDomNode* self,
      ArvDomNode* new_child,
      ArvDomNode* ref_child
    )

#### Description [src]

Inserts the node `new_child` before the existing child node `ref_child`. If `ref_child` is null, insert `new_child` at the end of the list of children. If the `new_child` is already in the tree, it is first removed.

#### Parameters

`new_child`

  Type: `ArvDomNode`

  Node to insert.

  The instance takes ownership of the data, and is responsible for freeing it.

`ref_child`

  Type: `ArvDomNode`

  Reference node, i.e., the node before which the new node must be inserted.

  The data is owned by the caller of the method.

#### Return value

Type: `ArvDomNode`

The inserted node.

The returned data is owned by the instance.