DOMDocument->xinclude()
Substitutes XIncludes in a DOMDocument Object
&reftitle.description;
DOMDocumentintxincludeintoptions
This method substitutes XIncludes in a DOMDocument object.
Due to libxml2 automatically resolving entities, this method will produce
unexpected results if the included XML file have an attached DTD.
&reftitle.parameters;
options
libxml parameters. Available
since PHP 5.1.0 and Libxml 2.6.7.
&reftitle.returnvalues;
Returns the number of XIncludes in the document.
&reftitle.examples;
DOMDocument->xinclude() exampleBooks of the other guy..xinclude: book.xml not found
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();
?>
]]>
&example.outputs.similar;
Books of the other guy..The Grapes of WrathJohn Steinbecken0140186409The PearlJohn Steinbecken014017737XSamarcandeAmine Maalouffr2253051209
]]>