mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@330760 c90b9560-bf6c-de11-be94-00142212c4b1
145 lines
3.6 KiB
XML
145 lines
3.6 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 656d1610af1a960d87c8b7056e54d0d4c75fb123 Maintainer: seros Status: ready -->
|
|
<refentry xml:id="domdocument.xinclude" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>DOMDocument::xinclude</refname>
|
|
<refpurpose>
|
|
Sustituye XIncludes en un objeto DOMDocument
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>int</type><methodname>DOMDocument::xinclude</methodname>
|
|
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Este método sustituye <link
|
|
xlink:href="&url.xinclude.spec;">XIncludes</link> en un objeto DOMDocument.
|
|
</para>
|
|
<note>
|
|
<para>
|
|
Debido a que libxml2 resuelve automáticamente entidades, este método producirá
|
|
resultados inesperados si el fichero XML incluido tiene un DTD adjunto.
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>options</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
<link linkend="libxml.constants">Parámetros de libxml</link>. Disponible
|
|
desde PHP 5.1.0 y Libxml 2.6.7.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el número de XIncludes del documento, -1 si falló algún proceso,
|
|
o &false; si no hubo sustituciones.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de DOMDocument::xinclude()</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$xml = <<<EOD
|
|
<?xml version="1.0" ?>
|
|
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
<title>Books of the other guy..</title>
|
|
<para>
|
|
<xi:include href="book.xml">
|
|
<xi:fallback>
|
|
<error>xinclude: book.xml not found</error>
|
|
</xi:fallback>
|
|
</xi:include>
|
|
</para>
|
|
</chapter>
|
|
EOD;
|
|
|
|
$dom = new DOMDocument;
|
|
|
|
// vamos a tener una impresión buena
|
|
$dom->preserveWhiteSpace = false;
|
|
$dom->formatOutput = true;
|
|
|
|
// cargar la cadena XML definida arriba
|
|
$dom->loadXML($xml);
|
|
|
|
// sustituir xincludes
|
|
$dom->xinclude();
|
|
|
|
echo $dom->saveXML();
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs.similar;
|
|
<screen role="xml">
|
|
<![CDATA[
|
|
<?xml version="1.0"?>
|
|
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
<title>Books of the other guy..</title>
|
|
<para>
|
|
<row xml:base="/home/didou/book.xml">
|
|
<entry>The Grapes of Wrath</entry>
|
|
<entry>John Steinbeck</entry>
|
|
<entry>en</entry>
|
|
<entry>0140186409</entry>
|
|
</row>
|
|
<row xml:base="/home/didou/book.xml">
|
|
<entry>The Pearl</entry>
|
|
<entry>John Steinbeck</entry>
|
|
<entry>en</entry>
|
|
<entry>014017737X</entry>
|
|
</row>
|
|
<row xml:base="/home/didou/book.xml">
|
|
<entry>Samarcande</entry>
|
|
<entry>Amine Maalouf</entry>
|
|
<entry>fr</entry>
|
|
<entry>2253051209</entry>
|
|
</row>
|
|
</para>
|
|
</chapter>
|
|
]]>
|
|
</screen>
|
|
</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:"~/.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
|
|
-->
|