ID: 14499
Updated by: ax@condat.de
Reported By: douglasd@iprimus.com.au
Status: Duplicate
Bug Type: Documentation problem
Operating System: windows 2000
PHP Version: 4.1.0
New Comment:
please note: the php_xslt.dll mentioned in my previous post only works
with php-4.1.2 (or was it 4.1.1?) and the mentioned sablotron binaries
(sablot.dll etc) replacing the default ones!
@ tim@zero-interactive.com: if you want xslt_set_encoding() to work on
a php windows version of your choice, you have to get the mentioned
sablotron binaries and recompile the php_xslt.dll with
HAVE_SABLOT_SET_ENCODING set. get the php sources, open
php4\ext\xslt\xslt.dsw, add "HAVE_SABLOT_SET_ENCODING" to project
options > c/c++ > preprocessor definitions, and go.
@ k.schroeder@php.net: i dont think this is the same as #14965: that
one is about files not found, this one here is about
HAVE_SABLOT_SET_ENCODING not compiled into the dll.
@ the php developers / windows binaries packager: again - i would
highly recommend to include the
appropriate changes (sablotron dll's with encoding support;
HAVE_SABLOT_SET_ENCODING defined) into the next windows binary release.
this
error is really frustrating for windows users because most of them
dont
have the possibility to recompile php.
Previous Comments:
------------------------------------------------------------------------
[2002-06-02 16:04:35] k.schroeder@php.net
Same problem as #14965.
Regards, Kai
------------------------------------------------------------------------
[2002-05-02 00:19:42] tim@zero-interactive.com
Same problem occurs with PHP 4.2.0 on Win2K.
Updating with the proposed dll by ax@condat.de doesn't fix it either.
Neither does setting the encoding in the xml and/or the xslt file.
Sorry Sterling, but I'd say it definitely is a bug
------------------------------------------------------------------------
[2002-03-28 15:29:44] ax@condat.de
i run into the same problem with the php-4.1.1/2 windows binaries. i
tried to solve the problem by getting the latest sablotron binaries for
windows (http://www.gingerall.com/charlie/ga/xml/d_sab.xml) - which do
include encoding support - but still got the "xslt_set_encoding() is
not supported in this PHP build". a look into the sources revealed the
problem:
ext\xslt\sablot.c
#ifdef HAVE_SABLOT_SET_ENCODING
PHP_FE(xslt_set_encoding, NULL)
#else
PHP_FALIAS(xslt_set_encoding, warn_not_available, NULL)
#endif
etc.
so i recompiled php_xslt with #define HAVE_SABLOT_SET_ENCODING - and
voila - it works perfectly! (fyi: the dll is available from
http://kollm.org/php_xslt/php_xslt.dll)
as windows user typically dont compile php - they get the windows
binaries and expect them to work ;) - i would recommend to include the
appropriate changes (sablotron dll's with encoding support;
HAVE_SABLOT_SET_ENCODING defined) into the next binary release. this
error is really frustrating for windows users because most of them dont
have the possibility to recompile php.
thanks!
------------------------------------------------------------------------
[2001-12-14 11:59:35] sterling@php.net
In order to use utf-8 you must set the encoding from within your <?xml
?> block.. If you want to use the xslt_set_encoding() function than you
must compile sablotron itself with encoding support.
not a bug.
------------------------------------------------------------------------
[2001-12-13 17:52:07] douglasd@iprimus.com.au
I got this error using XSLT in PHP-4.1.0 on Windows 2000.
Warning: Sablotron error on line 1: unknown encoding '' in
e:\www\htdocs\home.php on line 151
Warning: Unknown persistent list entry type in module shutdown (11) in
Unknown on line 0
and when I add an encoding statement,
Warning: xslt_set_encoding() is not supported in this PHP build in
e:\www\htdocs\home.php on line 150
My code:
$xml = $doc->dumpmem();
$arguments = array(
'/_xml' => $xml,
);
// Allocate a new XSLT processor
$xh = xslt_create();
#xslt_set_encoding($xh, "utf-8");
// Process the document
$result = xslt_process($xh, 'arg:/_xml', $include_dir . $xslt_filename,
NULL, $arguments);
var_dump($result);
xslt_free($xh);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=14499&edit=1