#20939 [Fbk]: PHP stops executing script when using sax handlers
| From: | msopacua@php.net | Date: | Wed, 11 Dec 2002 18:37:43 +0000 |
| Subject: | #20939 [Fbk]: PHP stops executing script when using sax handlers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-27396@lists.php.net to get a copy of this message | ||
ID: 20939
Updated by: msopacua@php.net
Reported By: saltwater@saltwater.be
Status: Feedback
Bug Type: XSLT related
Operating System: Debian GNU/Linux 2.4.19
PHP Version: 4.2.3
New Comment:
1) remove --with-sablot from your configure line.
2) If iconv is linked in with Sablotron, then use --with-iconv-dir as
well.
3) This is most likely fixed already as this loop is actually a
segfault. (see my mail)
Previous Comments:
------------------------------------------------------------------------
[2002-12-11 10:19:38] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-latest.zip
I cannot replicate this problem with PHP 4.3.0 & Sablotron 0.96. If you
try the snapshot and still experience problems please include the
Sablotron version you are using in your report.
------------------------------------------------------------------------
[2002-12-11 09:31:50] saltwater@saltwater.be
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 this bug report at http://bugs.php.net/?id=20939&edit=1