|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23148 Call to undefined function: xslt_set_encoding()
Submitted: 2003-04-10 08:09 UTC Modified: 2003-04-23 03:57 UTC
Avg. Score:4.7 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: Lensman dot D at gmx dot net Assigned:
Status: Not a bug Package: XSLT related
PHP Version: 4.3.2RC1 OS: SuSE Linux 8.2, Kernel 2.4.19
Private report: No CVE-ID: None
 [2003-04-10 08:09 UTC] Lensman dot D at gmx dot net
My script:

  function nullHandler() { return ''; };
  $sha = array();
  $sha['get_all'] = 'nullHandler';

  $xmlDoc = 'xml_file.xml';
  $xslDoc = 'xsl_file.xsl';

    $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 &#151; Use form (POST) or querystring (GET)</b>";

  echo "Keywords: ".$Keywords."<p>\n";

  $xmlDoc .= "?mkt=de&amp;Keywords=$data";

  echo "XML: ".$xmlDoc."<p>\n";

  $xmlConn = fopen ("$xmlDoc", "r");
  if (!($xmlConn)) {
    echo "<b>Connection to XML feed could not be established!</b>";
  else {
    $xmlFeed = fread($xmlConn,20000);

  $xslConn = fopen ("$xslDoc", "r");
  if (!($xslConn)) {
    echo "<b>XSL file could not be found!</b>";
  else {
    $xslFeed = fread($xslConn,20000);

  $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));
  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

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-11 01:19 UTC]
Please try using this CVS snapshot:
For Windows:

And if it's still undefined, check config.log for the reason
why the check for SablotSetEncoding fails.

 [2003-04-17 09:54 UTC] Lensman dot D at gmx dot net
In the config.log I've found the followin concerning encoding:

configure:93011: checking for SablotGetOptions in -lsablot
configure:93042: gcc -o conftest -g -O2  -lstdc++ -Wl,-rpath,/usr/local/mysql/current/lib/mysql -L/usr/local/mysql/current/lib/mysql -Wl,-rpath,/usr/local/expat/lib -L/usr/local/expat/lib conftest.c -lsablot  -ljs -lexpat -lexpat -lcrypt -lmysqlclient -lpng -lz -lz -lresolv -lm -ldl -lnsl  -lcrypt >&5
/usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/ld: cannot find -lsablot
collect2: ld returned 1 exit status
configure:93045: $? = 1
configure: failed program was:
| #line 93018 "configure"
| /* confdefs.h.  */

Well, there is no "/usr/lib/gcc-lib/i486-suse-linux/3.2/../../../../i486-suse-linux/bin/ld", all I have a "/usr/lib/gcc-lib/i486-suse-linux/3.2/include" with an ending "gcj" and "objc"...
Maybe I'm missing some devel files?
 [2003-04-23 03:57 UTC]
From sources:

/* The user has to explicitly compile sablotron with sablotron encoding functions in order for SablotSetEncoding to be enabled. */

This means xslt_set_encoding() won't be available if your 
sablot installation hasn't got the SablotSetEncoding enabled.

not PHP bug.

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC