From 0c41d0c4b830032aa10a73ba64c305be47686b6f Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 12 Apr 2002 13:23:04 +0000 Subject: [PATCH] - fixed some errors in examples - document DomNode->remove_child() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@77864 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/domxml.xml | 76 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/functions/domxml.xml b/functions/domxml.xml index 12ab610100..0066b38662 100644 --- a/functions/domxml.xml +++ b/functions/domxml.xml @@ -1,5 +1,5 @@ - + DOM XML functions DOM XML @@ -543,6 +543,10 @@ DomNode_append_child + + DomNode_remove_child + + DomNode_has_child_nodes @@ -2012,6 +2016,11 @@ $newnode->set_attribute("align", "left"); get_elements_by_tagname("tbody"); $element = $elements[0]; $child = $element->first_child(); @@ -2147,6 +2156,11 @@ print_r($children); get_elements_by_tagname("informaltable"); print_r($elements); $element = $elements[0]; @@ -2179,7 +2193,7 @@ echo ""; Description - nodeDomNode->append_child + objectDomNode->append_child objectnewnode @@ -2236,8 +2250,14 @@ $newnode = $doc->append_child($node); Adding a child get_elements_by_tagname("informaltable"); print_r($elements); $element = $elements[0]; @@ -2251,6 +2271,7 @@ echo "
";
 $xmlfile = $dom->dump_mem();
 echo htmlentities($xmlfile);
 echo "
"; +?> ]]>
@@ -2264,6 +2285,57 @@ echo "";
+ + + DomNode->remove_child + + Removes child from list of children + + + + Description + + objectDomNode->remove_child + objectoldchild + + + This functions removes a child from a list of children. If child cannot + be removed or is not a child the function will return false. + If the child could be removed the functions returns the old child. + + + + Removing a child + +get_elements_by_tagname("tbody"); +$element = $elements[0]; +$children = $element->child_nodes(); +$child = $element->remove_child($children[0]); + +echo "
";
+$xmlfile = $dom->dump_mem(true);
+echo htmlentities($xmlfile);
+echo "
"; +?> +]]> +
+
+
+ + See also DomNode_append_child. + +
+
+ DomNode->has_child_nodes