<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; $TOC = array(); $TOC_DEPRECATED = array(); $PARENTS = array(); include_once dirname(__FILE__) ."/toc/class.domdocument.inc"; $setup = array ( 'home' => array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'de', ), 'this' => array ( 0 => 'domdocument.append.php', 1 => 'DOMDocument::append', 2 => 'Appends nodes after the last child node', ), 'up' => array ( 0 => 'class.domdocument.php', 1 => 'DOMDocument', ), 'prev' => array ( 0 => 'domdocument.adoptnode.php', 1 => 'DOMDocument::adoptNode', ), 'next' => array ( 0 => 'domdocument.construct.php', 1 => 'DOMDocument::__construct', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/dom/domdocument/append.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?> <div id="domdocument.append" class="refentry"> <div class="refnamediv"> <h1 class="refname">DOMDocument::append</h1> <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">DOMDocument::append</span> — <span class="dc-title">Appends nodes after the last child node</span></p> </div> <div class="refsect1 description" id="refsect1-domdocument.append-description"> <h3 class="title">Beschreibung</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><strong>DOMDocument::append</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="class.domnode.php" class="type DOMNode">DOMNode</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">...$nodes</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div> <p class="para rdfs-comment"> Appends one or many <code class="parameter">nodes</code> to the list of children after the last child node. </p> </div> <div class="refsect1 parameters" id="refsect1-domdocument.append-parameters"> <h3 class="title">Parameter-Liste</h3> <p class="para"> <dl> <dt><code class="parameter">nodes</code></dt> <dd> <p class="para"> The nodes to append. Strings are automatically converted to text nodes. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-domdocument.append-returnvalues"> <h3 class="title">Rückgabewerte</h3> <p class="para"> Es wird kein Wert zurückgegeben. </p> </div> <div class="refsect1 errors" id="refsect1-domdocument.append-errors"> <h3 class="title">Fehler/Exceptions</h3> <dl> <dt><strong><code><a href="dom.constants.php#constant.dom-hierarchy-request-err">DOM_HIERARCHY_REQUEST_ERR</a></code></strong></dt> <dd> <p class="para"> Wird ausgelöst, wenn dieser Knoten von einem Typ ist, der keine Kinder vom Typ eines der übergebenen <code class="parameter">nodes</code> zulässt, oder wenn der einzufügende Knoten einer der Vorfahren dieses Knotens oder dieser Knoten selbst ist. </p> </dd> <dt><strong><code><a href="dom.constants.php#constant.dom-wrong-document-err">DOM_WRONG_DOCUMENT_ERR</a></code></strong></dt> <dd> <p class="para"> Wird ausgelöst, wenn einer der übergebenen <code class="parameter">nodes</code> aus einem anderen Dokument erstellt wurde als dem, das diesen Knoten erstellt hat. </p> </dd> </dl> </div> <div class="refsect1 changelog" id="refsect1-domdocument.append-changelog"> <h3 class="title">Changelog</h3> <table class="doctable informaltable"> <thead> <tr> <th>Version</th> <th>Beschreibung</th> </tr> </thead> <tbody class="tbody"> <tr> <td>8.3.0</td> <td> Calling this method on a node without an owner document now works. Zuvor führte dies zu einer <span class="classname"><a href="class.domexception.php" class="classname">DOMException</a></span> mit dem Code <strong><code><a href="dom.constants.php#constant.dom-hierarchy-request-err">DOM_HIERARCHY_REQUEST_ERR</a></code></strong>. </td> </tr> </tbody> </table> </div> <div class="refsect1 examples" id="refsect1-domdocument.append-examples"> <h3 class="title">Beispiele</h3> <div class="example" id="domdocument.append.example.basic"> <p><strong>Beispiel #1 <span class="methodname"><strong>DOMDocument::append()</strong></span> example</strong></p> <div class="example-contents"><p> Adds nodes after the document root. </p></div> <div class="example-contents"> <div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br />$doc </span><span style="color: #007700">= new </span><span style="color: #0000BB">DOMDocument</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$doc</span><span style="color: #007700">-></span><span style="color: #0000BB">loadXML</span><span style="color: #007700">(</span><span style="color: #DD0000">"<hello/>"</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$doc</span><span style="color: #007700">-></span><span style="color: #0000BB">append</span><span style="color: #007700">(</span><span style="color: #DD0000">"beautiful"</span><span style="color: #007700">, </span><span style="color: #0000BB">$doc</span><span style="color: #007700">-></span><span style="color: #0000BB">createElement</span><span style="color: #007700">(</span><span style="color: #DD0000">"world"</span><span style="color: #007700">));<br /><br />echo </span><span style="color: #0000BB">$doc</span><span style="color: #007700">-></span><span style="color: #0000BB">saveXML</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div> <div class="example-contents screen"> <div class="annotation-interactive examplescode"><pre class="examplescode"><hello/> beautiful <world/></pre> </div> </div> </div> </div> <div class="refsect1 seealso" id="refsect1-domdocument.append-seealso"> <h3 class="title">Siehe auch</h3> <ul class="simplelist"> <li><span class="methodname"><a href="domparentnode.append.php" class="methodname" rel="rdfs-seeAlso">DOMParentNode::append()</a> - Appends nodes after the last child node</span></li> <li><span class="methodname"><a href="domdocument.prepend.php" class="methodname" rel="rdfs-seeAlso">DOMDocument::prepend()</a> - Prepends nodes before the first child node</span></li> </ul> </div> </div><?php manual_footer($setup); ?>