Bug #17579: xslt_set_sax_handlers does not work with processing instructions.
| From: | cywulf at ottawa dot com | Date: | Mon, 03 Jun 2002 15:58:25 +0000 |
| Subject: | Bug #17579: xslt_set_sax_handlers does not work with processing instructions. | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-9322@lists.php.net to get a copy of this message | ||
From: cywulf@ottawa.com
Operating system: Linux 2.4.19
PHP version: 4.2.1
PHP Bug Type: XSLT related
Bug description: xslt_set_sax_handlers does not work with processing instructions.
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 bug report at http://bugs.php.net/?id=17579&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17579&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17579&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17579&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17579&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17579&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17579&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17579&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17579&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17579&r=globals