php-doc-en/reference/domxml/functions/DomNode-remove-child.xml
Mehdi Achour 262e2e4dc7 WS, prepare for new style
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@188209 c90b9560-bf6c-de11-be94-00142212c4b1
2005-06-12 04:42:09 +00:00

73 lines
1.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.8 $ -->
<refentry id='function.domnode-remove-child'>
<refnamediv>
<refname>DomNode->remove_child</refname>
<refpurpose>
Removes child from list of children
</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>domtext</type><methodname>DomNode->remove_child</methodname>
<methodparam><type>domtext</type><parameter>oldchild</parameter></methodparam>
</methodsynopsis>
<para>
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.
</para>
<para>
<example>
<title>Removing a child</title>
<programlisting role="php">
<![CDATA[
<?php
include("example.inc");
if (!$dom = domxml_open_mem($xmlstr)) {
echo "Error while parsing the document\n";
exit;
}
$elements = $dom->get_elements_by_tagname("tbody");
$element = $elements[0];
$children = $element->child_nodes();
$child = $element->remove_child($children[0]);
echo "<PRE>";
$xmlfile = $dom->dump_mem(true);
echo htmlentities($xmlfile);
echo "</PRE>";
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>domnode_append_child</function>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->