1
0
mirror of https://github.com/php/doc-es.git synced 2026-03-24 07:22:16 +01:00
Files
2025-05-08 23:23:26 +02:00

86 lines
2.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: c1349f9574ed77c268c6312a07466f06d59e5078 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="domdocument.prepend" 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::prepend</refname>
<refpurpose>Añade nodos antes del primer nodo hijo</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="DOMDocument">
<modifier>public</modifier> <type>void</type><methodname>DOMDocument::prepend</methodname>
<methodparam rep="repeat"><type class="union"><type>DOMNode</type><type>string</type></type><parameter>nodes</parameter></methodparam>
</methodsynopsis>
<para>
Añade uno o varios <parameter>nodes</parameter> a la lista de hijos antes del primer nodo hijo.
</para>
</refsect1>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.prepend')/db:refsect1[@role='parameters'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.prepend')/db:refsect1[@role='returnvalues'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.prepend')/db:refsect1[@role='errors'])" />
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('domparentnode.prepend')/db:refsect1[@role='changelog'])" />
<refsect1 role="examples">
&reftitle.examples;
<example xml:id="domdocument.prepend.example.basic">
<title>Ejemplo de <methodname>DOMDocument::prepend</methodname></title>
<para>
Añade nodos antes del nodo raíz del documento.
</para>
<programlisting role="php">
<![CDATA[
<?php
$doc = new DOMDocument;
$doc->loadXML("<world/>");
$doc->prepend($doc->createElement("hello"), "beautiful");
echo $doc->saveXML();
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
<?xml version="1.0"?>
<hello/>
beautiful
<world/>
]]>
</screen>
</example>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<simplelist>
<member><methodname>DOMParentNode::prepend</methodname></member>
<member><methodname>DOMDocument::append</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
-->