|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-12-11 10:19 UTC] iliaa@php.net
[2002-12-11 12:37 UTC] msopacua@php.net
[2002-12-13 10:48 UTC] Bruno <saltwater at saltwater dot be>
[2002-12-30 08:17 UTC] Bruno Windels <saltwater at saltwater dot be>
[2002-12-30 08:18 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 16:00:01 2025 UTC |
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