2004-05-09 15:07:48 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2005-02-14 18:01:02 +00:00
|
|
|
<!-- $Revision: 1.10 $ -->
|
2004-12-20 15:57:49 +00:00
|
|
|
<refentry id="function.dom-domdocument-xinclude">
|
|
|
|
<refnamediv>
|
2004-12-31 11:49:57 +00:00
|
|
|
<refname>DOMDocument->xinclude()</refname>
|
2004-12-20 15:57:49 +00:00
|
|
|
<refpurpose>
|
|
|
|
Substitutes XIncludes in a DOMDocument Object
|
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<classsynopsis>
|
|
|
|
<ooclass><classname>DOMDocument</classname></ooclass>
|
|
|
|
<methodsynopsis>
|
2005-01-17 08:41:34 +00:00
|
|
|
<type>int</type><methodname>xinclude</methodname>
|
2005-01-02 13:48:14 +00:00
|
|
|
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
|
2004-12-20 15:57:49 +00:00
|
|
|
</methodsynopsis>
|
|
|
|
</classsynopsis>
|
|
|
|
<para>
|
|
|
|
This method substitutes <ulink
|
|
|
|
url="&url.xinclude.spec;">XIncludes</ulink> in a DOMDocument object.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
Due to libxml2 automatically resolving entities, this method will produce
|
|
|
|
unexpected results if the included XML file have an attached DTD.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
2005-01-02 13:48:14 +00:00
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>options</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-02-14 18:01:02 +00:00
|
|
|
<link linkend="libxml.constants">libxml parameters</link>. Available
|
2005-01-08 19:55:51 +00:00
|
|
|
since PHP 5.1.0 and Libxml 2.6.7.
|
2005-01-02 13:48:14 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2004-12-20 15:57:49 +00:00
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns the number of XIncludes in the document.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>DOMDocument->xinclude() example</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;
|
|
|
|
|
|
|
|
// let's have a nice output
|
|
|
|
$dom->preserveWhiteSpace = false;
|
|
|
|
$dom->formatOutput = true;
|
|
|
|
|
|
|
|
// load the XML string defined above
|
|
|
|
$dom->loadXML($xml);
|
|
|
|
|
|
|
|
// substitute 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>
|
2004-05-09 15:07:48 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
-->
|