ID: 46827 Comment by: tailwind dot technologies at gmail dot com Reported By: danny at isratrade dot co dot il Status: Open Bug Type: DOM XML related Operating System: Ubuntu PHP Version: 5.2.8 New Comment:
Is anyone taking care of bugs here? Previous Comments: ------------------------------------------------------------------------ [2008-12-11 00:57:05] danny at isratrade dot co dot il I read the manual page about this function and a comment there suggests to just call xinclude() multiple times. As a test, I've also tried just calling "$document->xinclude();" a bunch of times instead of doing the search/loop.\ So even if all that code is replaced by: $document->xinclude(); $document->xinclude(); $document->xinclude(); It still doesn't include these other includes. ------------------------------------------------------------------------ [2008-12-11 00:29:34] danny at isratrade dot co dot il Description: ------------ I'm trying to include all the xi:include tags in a file but PHP seems to just ignore some of them. I'm using XML's that are known to work 100%. You can see the XML files here: http://postbooks.svn.sourceforge.net/viewvc/postbooks/xtupledocs/trun k/referenceguide.tar.gz?view=tar Basically the problematic file is products.xml which is included from referenceguide.xml and contains more includes. They all get ignored. Reproduce code: --------------- ... echo "Importing XML document...\n"; $document = new DOMDocument(); $document->load( DOCBOOK_PATH ); echo "Parsing <xi:include> tags...\n"; xinclude_all( $document ); ... function xinclude_all( &$document ){ $counter = 0; $xpath = new DOMXPath($document); $xpath->registerNamespace('xi', $ns = 'http://www.w3.org/2001/XInclude'); $includes = $xpath->query( "//xi:include" ); while($includes->length){ $counter++; echo "Parsing <xi:include> layer number $counter. {$includes->length} <xi:include> tags on this layer. "; $document->xinclude(); $includes = $xpath->query( "//xi:include" ); echo "{$includes->length} includes to process on next layer\n"; } echo "$counter <xi:include> tag levels parsed.\n"; } Expected result: ---------------- I expect all the includes to be parsed and included. Actual result: -------------- Only the 12 includes in the main referenceguide.xml file get included, then it just says that there is no need to further include as if there were 0 more includes in the DOM tree. But the included data isn't there. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46827&edit=1