php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #16228 XSLT file path issues
Submitted: 2002-03-22 22:04 UTC Modified: 2002-12-29 01:06 UTC
Votes:5
Avg. Score:4.6 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: shanx at shanx dot com Assigned: royhuggins (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.3.0-dev OS: Any
Private report: No CVE-ID: None
 [2002-03-22 22:04 UTC] shanx at shanx dot com
I have installed sablotron (as indicated here: http://shanx.com/php/xsl/getXsl.htm) and XSLT itself seems to be working. However, I have a problem with file paths, or rather where I need to put the XSL and the XML files. 

My directory structure is like this:

    webroot = c:\apache\htdocs
    phproot = c:\apache\php

Let us say that I try my XSLT samples in:

    c:\apache\htdocs\xsltest

    (sample code at the link above)
 
I try putting my xsl files (1.xsl, 1.xml) into this folder but it doesnt work and gives me an error that tells me that the files cannot be found in "c:\apache\php". Which is the phproot! 

When I put the files in "c:\apache\php" (phproot) it works.

Why does php_xslt.dll expect the files to be in PHP root rather than the document folder? How can i change this to be able to pick up files from the document root ("htdocs/xsltest" in my example) itself?

Thanks,
Shanx


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-25 14:41 UTC] hash at huasing dot com
not really a but, 
this should work.

file://c:/apache/htdocs/xsltest/1.xsl

i don't mind prefixing the extra "file://", but at least this should be documented
 [2002-04-09 16:21 UTC] jimw@php.net
recategorizing as documentation problem.
 [2002-04-11 20:03 UTC] marklauter at hotmail dot com
I am also having this problem.  However, I don't think this should be considered a documentation problem.  I should be able to use relative paths when performing XSL transformations, and I can't.  In my opinion, having to specify an explicit path is not a good solution.  I don't have to use an explicit path when using include() and shouldn't when using XSLT either.

Thanks,

Mark
 [2002-09-26 01:41 UTC] mike at graftonhall dot co dot nz
I also agree, this is not a Decumentations Problem and should be reclassified. 

There is a bug in the xslt_process code that expects relative paths to be relative to apache exe's path (i'm using php as a module) eg for me it looks for files in i:/httpd/apache/. It should be looking in the path of the current script.

- Mike :-)
 [2002-10-08 08:17 UTC] Dominik dot Klein at lauffen dot de
I experienced this issue, too and solved it using xslt_set_base().

Anyway I think that this should default to the actual script-dir (like $PHP_SELF or something) so that you can use relative paths without having to worry about setting the paths right.
 [2002-10-08 13:52 UTC] msopacua@php.net
It's not *only* a doc problem.

There are/were some issues with how Sablotron resolves the current working dir for the various lookups.
It's now being discussed with Ginger Alliance and will be fixed in forthcoming 4.3.

In addition these rules will be documented properly, when they are agreed upon and worked out. They should be intuitive as described by Dominik.Klein@lauffen.de and that is the goal. There are however 3 types of relative paths in the entire transformation process:
1) entities and DTD's in data documents
2) documents via the document()/xsl:include etc. directives, in the stylesheet
3) entities and DTD's in the documents fetched in the documents in 1) and 2) -> recursive.
 [2002-10-28 10:55 UTC] sterling@php.net
This is really a documentation problem - not an interface problem...
 [2002-10-31 04:08 UTC] hotglare at hotmail dot com
When I used absolute path like:
c:/apache/htdocs/xsltest/1.xsl , I got a warning:
Sablotron error on line 1: XML parser error 4: not well-formed (invalid token) in ...  It seems to me absolute path won't work either.
 [2002-11-23 09:12 UTC] msopacua@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

The unexpected behavior has been fixed.
 [2002-11-23 09:17 UTC] msopacua@php.net
Re-opening as doc problem, as the new intuitive(tm) behavior needs to be documented.
 [2002-12-29 01:06 UTC] royhuggins@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

New Intuitive Behavior (tm) has been documented in xslt_set_base(). 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Aug 15 01:01:27 2024 UTC