From:             [EMAIL PROTECTED]
Operating system: Debian GNU/Linux 2.4.19
PHP version:      4.2.3
PHP Bug Type:     XSLT related
Bug description:  PHP stops executing script when using sax handlers

When using xslt_set_sax_handlers, php stops executing after xslt_process.
Below a script that should reproduce the problem (I tested it on 2 servers
to be sure):
<?php
        $resXSL=xslt_create();
        
xslt_set_sax_handlers($resXSL,array('element'=>array('start_element','end_element')));
        $aryArg['xml']=implode("\n",file(dirname(__FILE__).'/test.xml'));
        $aryArg['xsl']=implode("\n",file(dirname(__FILE__).'/test.xsl'));
        $strHTML = xslt_process($resXSL,'arg:xml','arg:xsl',NULL,$aryArg);
        xslt_free($resXSL);
        echo $strHTML;
        function start_element($resParser,$strName,$aryAttribs) {
                echo 'Start of '.$strName;
        }
        function end_element($resParser,$strName) {
                echo 'End of '.$strName;
        }
?>

When this is executed there is no output, when I comment the line where I
use xslt_set_sax_handlers, it works fine (the html is shown). When I
enable xslt logging sablotron seems to be in an endless loop:
Sablotron Message on line none, level log: Parsing 'arg:/xsl'...
Sablotron Message on line none, level log: Parse done in 0.002 seconds
Sablotron Message on line none, level log: Parsing 'arg:/xml'...
Sablotron Message on line none, level log: Parse done in 0.000 seconds
Sablotron Message on line none, level log: Executing stylesheet
'arg:/xsl'...

These lines are printed into the logfile about let's say 30 times, the
first time the message 
Sablotron Message on line none, level log: Execution done in 0.002
seconds
appears, the other let's say 29 times not.

When I comment the xslt_set_sax_handlers line the logfile only shows the 5
lines mentioned before and also the 'Execution don in .... seconds' line
as you would expect

My guess is that sablotron is stuck in a loop...

PHP is compiled with: --with-dom --with-sablot --with-expat -with-dom-xslt
--with-dom-exslt --enable-xslt' --with-xslt-sablot

If you want to get the xml/xsl files I used, you can get them at
http://bruno.webfx.be/xslt_test/

Thanks in advance,
Bruno
-- 
Edit bug report at http://bugs.php.net/?id=20939&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=20939&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=20939&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=20939&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=20939&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=20939&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=20939&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=20939&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=20939&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=20939&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=20939&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20939&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=20939&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=20939&r=isapi

Reply via email to