Files
archived-doc-pt-br/reference/dom/domdocument/replacechildren.xml
Leonardo Lara Rodrigues 9828cfe6ff sync with en rev
2025-03-06 15:24:15 -03:00

84 lines
2.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?><!-- EN-Revision: d6f54016d62904cfd8200604aadd5e3f0d9bad97 Maintainer: leonardolara Status: ready --><!-- CREDITS: fernandowobeto -->
<refentry xml:id="domdocument.replacechildren" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>DOMDocument::replaceChildren</refname>
<refpurpose>Substitui filhos no documento</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMDocument">
<modifier>public</modifier> <type>void</type><methodname>DOMDocument::replaceChildren</methodname>
<methodparam rep="repeat"><type class="union"><type>DOMNode</type><type>string</type></type><parameter>nodes</parameter></methodparam>
</methodsynopsis>
<para>
Substitui os filhos no documento por novos <parameter>nodes</parameter>.
</para>
</refsect1>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.replacechildren')/db:refsect1[@role='parameters'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.replacechildren')/db:refsect1[@role='returnvalues'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.replacechildren')/db:refsect1[@role='errors'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.replacechildren')/db:refsect1[@role='changelog'])" />
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="domdocument.replacechildren.example.basic">
<title>Exemplo de <methodname>DOMDocument::replaceChildren</methodname></title>
<para>
Substitui os filhos por novos nós.
</para>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument;
$doc->loadXML("<container><hello/></container>");
$doc->replaceChildren("beautiful", $doc->createElement("world"));
echo $doc->saveXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
beautiful
<world/>
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>DOMParentNode::replaceChildren</methodname></member>
<member><methodname>DOMDocument::append</methodname></member>
<member><methodname>DOMDocument::prepend</methodname></member>
</simplelist>
</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:"~/.phpdoc/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
-->