note 104264 modified in function.domdocument-xinclude by danbrown

From: Date: Sat, 04 Jun 2011 17:22:17 +0000
Subject: note 104264 modified in function.domdocument-xinclude by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-180252@lists.php.net to get a copy of this message
The xinclude method is defined as: int DomDocument->xinclude ( void ). However you can pass options to this method. If your xincluded file contains entities, these entities will not be resolved simply by setting the substituteEntities property of the DomDocument to "true". You must pass in options to the xinclude function. For example: <?php $doc = new DOMDocument(); //doc has entities, substitute them $doc->substituteEntities = true; $source = "/path/to/file.xml"; $doc->load($source); //do this to resolve entities in an xincluded file $options = LIBXML_NOENT; $doc->xinclude($options); ... ?> --was-- On the "DomDocument->xinclude" page the xinclude method is defined as: int DomDocument->xinclude ( void ). However you can pass options to this method. If your xincluded file contains entities, these entities will not be resolved simply by setting the substituteEntities property of the DomDocument to "true". You must pass in options to the xinclude function. For example: <?php $doc = new DOMDocument(); //doc has entities, substitute them $doc->substituteEntities = true; $source = "/path/to/file.xml"; $doc->load($source); //do this to resolve entities in an xincluded file $options = LIBXML_NOENT; $doc->xinclude($options); ... ?> http://php.net/manual/en/function.domdocument-xinclude.php

« previous php.notes (#180252) next »