#22868 [Opn->Fbk]: xslt_process() not reading files relative to script
ID: 22868
Updated by: sniper@php.net
Reported By: kirk at coraldesigns dot com
-Status: Open
+Status: Feedback
Bug Type: XSLT related
Operating System: Windows XP
PHP Version: 4.3.2RC1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2003-03-25 02:16:45] kirk at coraldesigns dot com
The xslt_process() command is expecting a uri relative to the path of
php.exe and not that of the script calling it.
Using an XML file and an XSL with the following script:
// script location: c:/apache/htdocs/pathto/test.php
<?php
$xsltproc = xslt_create();
$html = xslt_process($xsltproc, 'test.xml', 'test.xsl');
// some error checking left out for simplicity
echo $html;
?>
I get the following error:
XSLT processing error: cannot open file 'c:/apache/php/test.xsl'
I read the archives, and saw that this bug was previously reported for
4.3.0 and then closed as fixed in CVS. However 4.3.2 RC1 still
exhibits this behaviour. This was then re-tagged as a documentation
error, however this behaviour is not right, as developers should not
have access to the path with php.exe.
Some possible fixes which were recommended were to override the base
path with xslt_set_base(), however this would make the scripts machine
specific and reduce portability.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22868&edit=1
Thread (6 messages)