Description
object
DomNode- append_child
( object newnode)
The
child
can
be
created
with
e.g
.
DomDocument_create_element(
)
,
DomDocument_create_text(
)
etc
.
or
simply
by
using
any
other
node
.
The above example could also be written as the following:
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.
The above example could also be done with
DomNode_insert_before()
instead of
DomNode_append_child()
.
See
also
DomNode_insert_before(
)
,
DomNode_clone_node(
)
.