note 96306 added to function.domdocument-xinclude
| From: | collin at paperclipped dot com | Date: | Fri, 19 Feb 2010 18:03:45 +0000 |
| Subject: | note 96306 added to function.domdocument-xinclude | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-166189@lists.php.net to get a copy of this message | ||
I had to do things a bit differently to use xincludes (also following the example above only
included a part of the XML):
$xml = '<?xml version="1.0" encoding="utf-8"?>
<site xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="home.xml#xpointer(/site/*)">
<xi:fallback>
<error>Error: home.xml not found or invalid!</error>
</xi:fallback>
</xi:include>
<xi:include href="services.xml#xpointer(/site/*)">
<xi:fallback>
<error>Error: services.xml not found or invalid!</error>
</xi:fallback>
</xi:include>
<xi:include href="about.xml#xpointer(/site/*)">
<xi:fallback>
<error>Error: about.xml not found or invalid!</error>
</xi:fallback>
</xi:include>
<xi:include href="contact.xml#xpointer(/site/*)">
<xi:fallback>
<error>Error: contact.xml not found or invalid!</error>
</xi:fallback>
</xi:include>
</site>';
$xmlDoc = new DOMDocument();
$xmlDoc->loadXML($xml);
$xmlDoc->xinclude();
echo $xmlDoc->saveXML();
----
Server IP: 69.147.83.197
Probable Submitter: 209.6.44.237
----
Manual Page -- http://www.php.net/manual/en/function.domdocument-xinclude.php
Edit -- https://master.php.net/note/edit/96306
Del: integrated -- https://master.php.net/note/delete/96306/integrated
Del: useless -- https://master.php.net/note/delete/96306/useless
Del: bad code -- https://master.php.net/note/delete/96306/bad+code
Del: spam -- https://master.php.net/note/delete/96306/spam
Del: non-english -- https://master.php.net/note/delete/96306/non-english
Del: in docs -- https://master.php.net/note/delete/96306/in+docs
Del: other reasons-- https://master.php.net/note/delete/96306
Reject -- https://master.php.net/note/reject/96306
Search -- https://master.php.net/manage/user-notes.php