DomNode- append_child

DomNode- append_child -- Adds new child at the end of the children

Description

object DomNode- append_child ( object newnode)

Voorbeeld 1 .




The above example could also be written as the following:

Voorbeeld 2 .




A more comples example is the one below. It first searches for a certain element, duplicates it including its children and adds it as a sibling. Finally a new attribute is added to one of the children of the new sibling and the whole document is dumped.

Voorbeeld 3 .




The above example could also be done with domnode_insert_before() instead of domnode_append_child() .