From:             kirk at coraldesigns dot com
Operating system: Windows XP
PHP version:      4.3.2RC1
PHP Bug Type:     XSLT related
Bug description:  xslt_process() not reading files relative to script

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 bug report at http://bugs.php.net/?id=22868&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=22868&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=22868&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=22868&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=22868&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=22868&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=22868&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=22868&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=22868&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=22868&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=22868&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=22868&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=22868&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=22868&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=22868&r=gnused

Reply via email to