Last active
May 2, 2016 14:07
-
-
Save shulard/cb109c72ddb552ffedb2acee5b71587b to your computer and use it in GitHub Desktop.
How to use the `xi:include` tag in XML files...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0'?> | |
<disclaimer> | |
<p>The opinions represented herein represent those of the individual | |
and should not be interpreted as official policy endorsed by this | |
organization.</p> | |
</disclaimer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<document xmlns:xi="http://www.w3.org/2001/XInclude"> | |
<p>120 Mz is adequate for an average home user.</p> | |
<disclaimer> | |
<p>The opinions represented herein represent those of the individual | |
and should not be interpreted as official policy endorsed by this | |
organization.</p> | |
</disclaimer> | |
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0'?> | |
<document xmlns:xi="http://www.w3.org/2001/XInclude"> | |
<p>120 Mz is adequate for an average home user.</p> | |
<xi:include href="disclaimer.xml"/> | |
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$doc = new DOMDocument(); | |
$doc->load('root.xml'); | |
$doc->xinclude(); | |
echo $doc->saveXML(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment