#46827 [NEW]: disappearing xi:include tags?
| From: | danny at isratrade dot co dot il | Date: | Thu, 11 Dec 2008 00:29:34 +0000 |
| Subject: | #46827 [NEW]: disappearing xi:include tags? | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-131886@lists.php.net to get a copy of this message | ||
From: danny at isratrade dot co dot il
Operating system: Ubuntu
PHP version: 5.2.8
PHP Bug Type: DOM XML related
Bug description: disappearing xi:include tags?
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 bug report at http://bugs.php.net/?id=46827&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46827&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46827&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46827&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=46827&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46827&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=46827&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=46827&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=46827&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=46827&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=46827&r=support
Expected behavior: http://bugs.php.net/fix.php?id=46827&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=46827&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=46827&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=46827&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46827&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46827&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=46827&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=46827&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=46827&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=46827&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=46827&r=mysqlcfg