2002-08-13 14:03:17 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2009-07-11 06:55:13 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.domdocument-xinclude" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2002-08-13 14:03:17 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>DomDocument->xinclude</refname>
|
|
|
|
<refpurpose>
|
2004-08-20 09:37:01 +00:00
|
|
|
Substitutes XIncludes in a DomDocument Object
|
2002-08-13 14:03:17 +00:00
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
2004-11-01 16:40:58 +00:00
|
|
|
&reftitle.description;
|
2002-08-13 14:03:17 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>DomDocument->xinclude</methodname>
|
|
|
|
<void/>
|
|
|
|
</methodsynopsis>
|
2004-08-29 18:54:42 +00:00
|
|
|
<para>
|
2007-06-20 22:25:43 +00:00
|
|
|
This function substitutes <link
|
|
|
|
xlink:href="&url.xinclude.spec;">XIncludes</link> in a DomDocument object.
|
2004-08-29 18:54:42 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
2005-01-12 10:59:42 +00:00
|
|
|
<title>Substituting Xincludes</title>
|
2004-08-29 18:54:42 +00:00
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2002-08-13 14:03:17 +00:00
|
|
|
|
2004-08-29 18:54:42 +00:00
|
|
|
// include.xml contains :
|
|
|
|
// <child>test</child>
|
|
|
|
|
|
|
|
$xml = '<?xml version="1.0"?>
|
|
|
|
<root xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<xi:include href="include.xml">
|
|
|
|
<xi:fallback>
|
|
|
|
<error>xinclude: include.xml not found</error>
|
|
|
|
</xi:fallback>
|
|
|
|
</xi:include>
|
|
|
|
</root>';
|
|
|
|
|
|
|
|
$domxml = domxml_open_mem($xml);
|
|
|
|
$domxml->xinclude();
|
|
|
|
|
|
|
|
echo $domxml->dump_mem();
|
|
|
|
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
&example.outputs;
|
|
|
|
<screen role="xml">
|
|
|
|
<![CDATA[
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<root xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<child>test</child>
|
|
|
|
</root>
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
<para>
|
|
|
|
If <filename>include.xml</filename> doesn't exist, you'll see:
|
|
|
|
</para>
|
|
|
|
<screen role="xml">
|
|
|
|
<![CDATA[
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<root xmlns:xi="http://www.w3.org/2001/XInclude">
|
|
|
|
<error>xinclude:dom.xml not found</error>
|
|
|
|
</root>
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
2002-08-13 14:03:17 +00:00
|
|
|
</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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-08-13 14:03:17 +00:00
|
|
|
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
|
|
|
|
-->
|