php.net |  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
Votes:28
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ahundiak at ingr dot com
New email:
PHP Version: OS:

 

 [2004-04-07 12:34 UTC] ahundiak at ingr dot com
Description:
------------
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(); 
xml_set_default_handler($xp,'x_default_handler'); 
xml_parse($xp,'<root></root>',TRUE); 
xml_parser_free($xp); 
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 19:45 UTC] sniper@php.net
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] sniper@php.net
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] sniper@php.net
See also bug #32441 for another example script.

 [2005-08-30 22:24 UTC] andrei@php.net
Rob, you grok libxml2 better than me, mind taking a look at this one?
 [2005-09-01 04:39 UTC] rrichards@php.net
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] rrichards@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 06 08:01:28 2024 UTC