diff --git a/reference/domxml/functions.xml b/reference/domxml/functions.xml index ff837178ea..bb8e6c943b 100644 --- a/reference/domxml/functions.xml +++ b/reference/domxml/functions.xml @@ -52,6 +52,7 @@ &reference.domxml.functions.DomNode-prefix; &reference.domxml.functions.DomNode-previous-sibling; &reference.domxml.functions.DomNode-remove-child; +&reference.domxml.functions.DomNode-replace-child; &reference.domxml.functions.DomNode-replace-node; &reference.domxml.functions.DomNode-set-content; &reference.domxml.functions.DomNode-set-name; diff --git a/reference/domxml/functions/DomNode-replace-child.xml b/reference/domxml/functions/DomNode-replace-child.xml new file mode 100644 index 0000000000..c221f0ca44 --- /dev/null +++ b/reference/domxml/functions/DomNode-replace-child.xml @@ -0,0 +1,49 @@ + + + + + DomNode->replace_child + + Replaces a child + + + + Description + + objectDomNode->replace_child + objectoldnode + objectnewnode + + + + This function replaces the child oldnode + with the passed new node. If the new node is already a child it + will not be added a second time. If the old node cannot be found + the function returns false. If the replacement succeds the old node + is returned. + + + See also DomNode_append_child + + + + diff --git a/reference/domxml/functions/DomNode-replace-node.xml b/reference/domxml/functions/DomNode-replace-node.xml index bddba9cc00..1bb2cf65c0 100644 --- a/reference/domxml/functions/DomNode-replace-node.xml +++ b/reference/domxml/functions/DomNode-replace-node.xml @@ -1,5 +1,5 @@ - + @@ -18,9 +18,10 @@ This function replaces an existing node with the passed new node. Before the replacement - newnode is copied to make sure a node which is + newnode is copied if it has a parent to + make sure a node which is already in the document will not be inserted a second time. This - behaviour enforces to do all modifications on the node before the + behaviour enforces doing all modifications on the node before the replacement or to refetch the inserted node afterwards with functions like DomNode_first_child, DomNode_child_nodes etc..