Method

LasemDomNodereplace_child

Declaration

LsmDomNode*
lsm_dom_node_replace_child (
  LsmDomNode* self,
  LsmDomNode* new_child,
  LsmDomNode* old_child
)

Description

Replaces the child node old_child with new_child in the list of children, and returns the old_child node. If the new_child is already in the tree, it is first removed.

Parameters

new_child

Type: LsmDomNode

A replacement node.

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

Type: LsmDomNode

Node to replace.

The data is owned by the caller of the function.

Return value

Type: LsmDomNode

The replaced node.

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