#23148 [NEW]: Call to undefined function: xslt_set_encoding()
| From: | Lensman dot D at gmx dot net | Date: | Thu, 10 Apr 2003 13:09:47 +0000 |
| Subject: | #23148 [NEW]: Call to undefined function: xslt_set_encoding() | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-37518@lists.php.net to get a copy of this message | ||
From: Lensman dot D at gmx dot net
Operating system: SuSE Linux 8.2, Kernel 2.4.19
PHP version: 4.3.2RC1
PHP Bug Type: XSLT related
Bug description: Call to undefined function: xslt_set_encoding()
My script:
<?php
function nullHandler() { return ''; };
$sha = array();
$sha['get_all'] = 'nullHandler';
$xmlDoc = 'xml_file.xml';
$xslDoc = 'xsl_file.xsl';
if ($REQUEST_METHOD=='POST') {
$data = $Keywords;
$data = ereg_replace(" ", "+", $data);
$data = ereg_replace("%20", "+", $data);
}
elseif ($QUERYSTRING) {
$data = $Keywords;
$data = ereg_replace(" ", "+", $data);
$data = ereg_replace("%20", "+", $data);
}
else {
echo "<b>Missing XML Query — Use form (POST) or querystring
(GET)</b>";
exit;
}
echo "Keywords: ".$Keywords."<p>\n";
$xmlDoc .= "?mkt=de&Keywords=$data";
echo "XML: ".$xmlDoc."<p>\n";
$xmlConn = fopen ("$xmlDoc", "r");
if (!($xmlConn)) {
echo "<b>Connection to XML feed could not be established!</b>";
exit;
}
else {
$xmlFeed = fread($xmlConn,20000);
}
fclose($xmlConn);
$xslConn = fopen ("$xslDoc", "r");
if (!($xslConn)) {
echo "<b>XSL file could not be found!</b>";
exit;
}
else {
$xslFeed = fread($xslConn,20000);
}
fclose($xslConn);
$arguments = array('/_xml' => $xmlFeed,'/_xsl' => $xslFeed);
$xsltproc = xslt_create();
xslt_set_encoding($xsltproc, "ISO-8859-1");
xslt_set_scheme_handlers( $xsltproc, $sha );
$html = xslt_process($xsltproc, 'arg:/_xml', 'arg:/_xsl', NULL,
$arguments);
if (!($html)) die('XSLT processing error: '.xslt_error($xsltproc));
xslt_free($xsltproc);
echo $html;
?>
By calling the script above I get the following error:
Fatal error: Call to undefined function: xslt_set_encoding() in
/usr/local/apache2/2.0.44/htdocs/overture/transform.php on line 54
Environment:
Linux
Kernel 2.4.19
Apache 2.0.44
PHP 4.3.2RC1 (./configure --with-apxs2=/usr/local/apache2/current/bin/apxs
--with-mysql=/usr/local/mysql/current --with-zlib-dir=/usr/lib/
--enable-versioning --enable-track-vars=yes --enable-url-includes
--enable-trans-sid --enable-syssvshm=yes --enable-syssvsem=yes
--enable-ftp --with-config-file-path=/etc --with-gd --enable-xslt
--with-xslt-sablot=/usr/local/sablot --with-expat-dir=/usr/local/expat
--enable-javascript --with-sablot-js=/usr)
Expat 1.95.6
Sablotron 0.98
JS 1.5.4-3
--
Edit bug report at http://bugs.php.net/?id=23148&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23148&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23148&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23148&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23148&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23148&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23148&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23148&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23148&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23148&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23148&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23148&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23148&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23148&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23148&r=gnused