xml xinclude

From: Date: Wed, 08 Jan 2003 14:35:26 +0000
Subject: xml xinclude
Groups: php.dev 
Request: Send a blank email to php-dev+get-93261@lists.php.net to get a copy of this message
Hello, libxml (tested with 2.4.30) creates these additional nodes when parsing documents with xincludes: XML_XINCLUDE_START and XML_XINCLUDE_END. PHP has no support for these nodes and chokes when it encounters them, therefore walking the xml tree after issuing $doc->xinclude() fails. The only work-around I could come up with is: $doc = domxml_open_mem($doc->dump_mem()) which gets rid of the XML_XINCLUDE_START and XML_XINCLUDE_END nodes The problem comes up when you have entities in the xincluded document, which don't get substituted. This short patch substitutes any entity references you might have in the xincluded document. Pawel

--- ext/domxml/php_domxml.c.backup 2003-01-08 09:11:23.000000000 -0500 +++ ext/domxml/php_domxml.c 2003-01-08 09:13:09.000000000 -0500 @@ -4848,11 +4848,14 @@ zval *id; xmlDoc *docp; int err; + int prevSubstValue; DOMXML_PARAM_NONE(docp, id, le_domxmldocp); + prevSubstValue = xmlSubstituteEntitiesDefault (1); err = xmlXIncludeProcess (docp); - + xmlSubstituteEntitiesDefault (prevSubstValue); + if (err) { RETVAL_LONG(err); } else {
« previous php.dev (#93261) next »