Date: 01/26/01
- Next message: garey: "[PHP-DEV] You can have a visa card .. no deposit"
- Previous message: glen <email protected>: "[PHP-DEV] PHP 4.0 Bug #8940 Updated: File uploads stopped withing in 4.0.4pl1"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: abravo <email protected>
Operating system: Linux (kernel 2.2.10,glibc-2.0.7)
PHP version: 4.0.4pl1
PHP Bug Type: Sablotron XSL
Bug description: xslt_process randomly fails on valid xml/xsl data (xslt_run works fine)
This script randomly fails (on the same xml/xsl data it works or randomly fails with the only error:
Fatal error: msgtype: error in /home/httpd/html/photo/tstxsl1.php on line 29
, which is xslt_process call.
I can't set the user error handler while using xslt_process to get more error information, because can't pass $parser to this function.) :
<?php
function xsl_error($parser, $code, $level, $errors)
{
echo "Parser: $parser\n<br>\n";
echo "Code: $code\n<br>\n";
echo "Level: $level\n<br>\n";
echo "Errors: \n<br>\n<br>\n";
var_dump($errors);
}
$fp = fopen("pic1.xsl", "r");
$lenxsl = filesize("pic1.xsl");
$xslData = fread($fp, $lenxsl);
fclose($fp);
$fp = fopen("pic.xml", "r");
$lenxml = filesize("pic.xml");
$xmlData = fread($fp, $lenxml);
fclose($fp);
/*
Parser creation could be omitted, it doesn't influence on the random crashes
*/
$parser = xslt_create();
print "Parser Handle[$parser]<br>";
xslt_set_error_handler($parser, "xsl_error");
if (xslt_process($xslData, $xmlData, $result))
{
echo $result;
} else {
echo "\tError number: " . xslt_errno() . "\n";
echo "\tError string: " . xslt_error() . "\n";
exit;
}
/* this should be omitted if xsl_creat() is commented out */
xslt_free($parser);
?>
Sablotron comand line utility sabcmd parses xml/xsl data from the files pic1.xsl and pic.xml without any errors/warnings.
The following script, which doesn't use xslt_process, works stable and without errors on the same data files:
<?php
function xsl_error($parser, $code, $level, $errors)
{
echo "Parser: $parser\n<br>\n";
echo "Code: $code\n<br>\n";
echo "Level: $level\n<br>\n";
echo "Errors: \n<br>\n<br>\n";
var_dump($errors);
}
$parser = xslt_create();
print "Parser Handle[$parser]<br>";
xslt_set_error_handler($parser, "xsl_error");
xslt_run($parser, './pic1.xsl', './pic.xml');
print "<br>Here is the output:<br>".xslt_fetch_result($parser);
xslt_free($parser);
?>
But I need at least xml "in-memory" data for my application, so I can't use xslt_run for my production purposes.
Suggestion - something wrong with xslt_process :)
php.ini - standard configuration from php4.04pl1 distribution
Sablotron 0.50
Expat 1.95.1
php4 configuration:
--with-apxs --prefix=/usr --with-gd --with-gettext --with-yp --with-system-regex --with-mysql=/usr --enable-safe-mode --enable-sysvsem --enable-sysvshm --with-exec-dir=/home/httpd/php/bin --with-zlib --with-config-file-path=/etc/httpd --disable-debug --enable-magic-quotes --enable-bcmath --with-mod_charset --with-pdflib --with-cpdflib --enable-calendar --with-sablot
configure script was hacked a little to provide libexpat and libiconv (glibc-2.0.7 has no native iconv) for Sablotron
instead of old libxmlparse and libxmltok. There were no any problem with compilation of php4.
-- Edit Bug report at: http://bugs.php.net/?id=8928&edit=1-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: garey: "[PHP-DEV] You can have a visa card .. no deposit"
- Previous message: glen <email protected>: "[PHP-DEV] PHP 4.0 Bug #8940 Updated: File uploads stopped withing in 4.0.4pl1"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

