|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-05-30 03:45 UTC] sitnikov at infonet dot ee
After upgrade PHP from 4.2.3 into 4.3.2 xslt transformation stop working.
1.php (not working)
<?
// Allocate a new XSLT processor
$xh = xslt_create() or die('Can not do; xslt_create()');
$arguments = array(
'/_xml' => file_get_contents('xml/1.xml'),
'/_xsl' => file_get_contents('xsl/1.xsl'),
);
// Process the document
if ( $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments) ) {
print "SUCCESS, test.xml was transformed by test.xsl into result.xml";
print ", result.xml has the following contents\n<br>\n";
print "<pre>\n";
echo $result;
print "</pre>\n";
}
else {
print "Sorry, test.xml could not be transformed by test.xsl into";
print " result.xml the reason is that " . xslt_error($xh) . " and the ";
print "error code is " . xslt_errno($xh);
}
xslt_free($xh);
?>
2.php - working
<?
// Allocate a new XSLT processor
$xh = xslt_create() or die('Can not do; xslt_create()');
$arguments = array(
'/_xml' => file_get_contents('xml/1.xml'),
);
// Process the document
if ( $result = xslt_process($xh, 'arg:/_xml', 'xsl/1.xsl', NULL, $arguments) ) {
print "SUCCESS, test.xml was transformed by test.xsl into result.xml";
print ", result.xml has the following contents\n<br>\n";
print "<pre>\n";
echo $result;
print "</pre>\n";
}
else {
print "Sorry, test.xml could not be transformed by test.xsl into";
print " result.xml the reason is that " . xslt_error($xh) . " and the ";
print "error code is " . xslt_errno($xh);
}
xslt_free($xh);
?>
Test full suite: http://si.infonet.ee/sablot.rar
xml & xsl you can see in rar file.
after some research i found what problem in http://cvs.php.net/diff.php/php4/ext/xslt/sablot.c?login=2&r1=1.63&r2=1.64&ty=u patch.
after removing this patch my code again work.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 23:00:01 2025 UTC |
Yes, problem still exists with 4.3.3RC3 This problem will appear if xsl contains: <xsl:variable name="sort-images" select="document('')/xsl:stylesheet/xxxx"/> and sablot try parse not current xsl, but it parse current PHP file as xsl Workaroud for this problem use xslt_set_base($xh,''); before xslt_process().