|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27908 xml default_handlers not being called when using libxml (works fine with expat)
Submitted: 2004-04-07 12:34 UTC Modified: 2005-10-12 05:22 UTC
Avg. Score:4.9 ± 0.4
Reproduced:8 of 8 (100.0%)
Same Version:2 (25.0%)
Same OS:3 (37.5%)
From: ahundiak at ingr dot com Assigned: rrichards (profile)
Status: Closed Package: XML related
PHP Version: 5CVS-2005-08-19 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ahundiak at ingr dot com
New email:
PHP Version: OS:


 [2004-04-07 12:34 UTC] ahundiak at ingr dot com
As the test case shows, it does not appear that the default handler is being called under PHP5RC1.  The other handlers seem to work but the default handler is required to get the document type line.  PHP4.3.5 works. Using libxml2 2.6.5.

Reproduce code:
function x_default_handler($xp,$data) 
    echo "x_default_handler $data\n"; 
$xp = xml_parser_create(); 
echo "Parse Test " . PHP_VERSION . " Done\n"; 

Expected result:
x_default_handler <root> 
x_default_handler </root> 
Parse Test 5.0.0RC1 Done 

Actual result:
Parse Test 5.0.0RC1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 19:45 UTC]
It is a bug in the compatibility layer used when ext/xml is build with libxml2. It works fine with expat. 

 [2005-03-18 16:22 UTC] werner at esmt dot org
..but what can i do, if i want to run my current php4 
applications with php5 and other webs the new libxml2 
stuff? its not really a solution, only a workaround ...
 [2005-03-24 18:31 UTC]
You can always tell ext/xml to use external expat libraries 
by using --with-libxml-dir configure option (it won't help of course if you're using precompiled binaries)

 [2005-03-24 18:33 UTC]
See also bug #32441 for another example script.

 [2005-08-30 22:24 UTC]
Rob, you grok libxml2 better than me, mind taking a look at this one?
 [2005-09-01 04:39 UTC]
All default handling needs to be hand coded in compat.c for each of the different events while also trying to keep the same behavior as expat.
 [2005-10-12 05:22 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Mar 02 04:01:28 2024 UTC