Bug #17579 Updated: Handler set by xslt_set_sax_handlers gets random data.

From: Date: Mon, 03 Jun 2002 18:32:30 +0000
Subject: Bug #17579 Updated: Handler set by xslt_set_sax_handlers gets random data.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-9372@lists.php.net to get a copy of this message
ID: 17579 Updated by: cywulf@ottawa.com -Summary: xslt_set_sax_handlers does not work with processing instructions. Reported By: cywulf@ottawa.com Status: Open Bug Type: XSLT related Operating System: Linux 2.4.19 PHP Version: 4.2.1 New Comment: I have since verified that the same behaviour applies to comment handlers. Interestingly, if a PI handler and comment handler are both triggered on the same page, they will both receive the SAME random data in their content fields. When trying to check the behaviour of character data handlers, Apache segfaulted every time. [notice] child pid 5537 exit signal Segmentation fault (11) Forgot to specify that my expat version is 1.95.2. Previous Comments: ------------------------------------------------------------------------ [2002-06-03 11:58:24] cywulf@ottawa.com SAX handlers attached to an XSL transform via xslt_set_sax_handlers are not performing as expected when the target is a processing instruction. In fact, the handler is passed completely random data, generally non-printing characters, in place of the PI content. Test system is running Sablotron 0.90, on Apache 1.3.24. PHP is configured using --enable-xslt and --with-xslt-sablot (among many other options). Minimal sample code follows. <?php $xslt = xslt_create(); $args = array( "/_xml" => '<?xml version="1.0" encoding="UTF-8"?> <test />', "/_xsl" => '<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="test"> <xsl:processing-instruction name="php"><![CDATA[ print "hello world"; ]]></xsl:processing-instruction> </xsl:template> </xsl:stylesheet>' ); function handle_pi($processor, $content, $target) { echo '<pre>'; echo "processor: $processor\n"; echo "target: $target\n"; echo "content: $content\n"; echo '</pre>'; } xslt_set_sax_handlers($xslt, array('pi'=>'handle_pi')); xslt_process($xslt, "arg:/_xml", "arg:/_xsl", NULL, $args); xslt_free($xslt); ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=17579&edit=1

« previous php.bugs (#9372) next »