mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 05:48:57 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@174985 c90b9560-bf6c-de11-be94-00142212c4b1
68 lines
1.9 KiB
XML
68 lines
1.9 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.4 $ -->
|
|
<refentry id='function.dom-domnode-appendchild'>
|
|
<refnamediv>
|
|
<refname>DOMNode->appendChild</refname>
|
|
<refpurpose>
|
|
Adds new child at the end of the children
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<classsynopsis>
|
|
<ooclass><classname>DOMNode</classname></ooclass>
|
|
<methodsynopsis>
|
|
<type>DOMNode</type>
|
|
<methodname>appendChild</methodname>
|
|
<methodparam><type>DOMNode</type><parameter>newnode</parameter></methodparam>
|
|
</methodsynopsis>
|
|
</classsynopsis>
|
|
<para>
|
|
This functions appends a child to an existing list of children or creates
|
|
a new list of children. The child can be created with e.g.
|
|
<link linkend="function.dom-domdocument-createelement">DOMDocument->createElement()</link>,
|
|
<link linkend="function.dom-domdocument-createtextnode">DOMDocument->createTextNode()</link>
|
|
etc. or simply by using any other node.
|
|
</para>
|
|
<para>
|
|
Throws <classname>DOMException</classname> if node cannot be appended.
|
|
</para>
|
|
<para>
|
|
The following example will add a new element node to a fresh document.
|
|
<example>
|
|
<title>Adding a child</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$doc = new DOMDocument();
|
|
$node = $doc->createElement("para");
|
|
$newnode = $doc->appendChild($node);
|
|
print $doc->saveXML();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</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
|
|
-->
|