|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46827 disappearing xi:include tags?
Submitted: 2008-12-11 00:29 UTC Modified: 2009-05-03 01:00 UTC
Avg. Score:4.4 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:2 (28.6%)
From: danny at isratrade dot co dot il Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.2.8 OS: Ubuntu
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: danny at isratrade dot co dot il
New email:
PHP Version: OS:


 [2008-12-11 00:29 UTC] danny at isratrade dot co dot il
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:

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 = '');
		$includes = $xpath->query( "//xi:include" );
			echo "Parsing <xi:include> layer number $counter. {$includes->length} <xi:include> tags on this layer. ";
			$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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-11 00:57 UTC] 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:
It still doesn't include these other includes.
 [2009-04-25 14:07 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

 [2009-05-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 23 16:01:29 2024 UTC