By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,663 Members | 762 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,663 IT Pros & Developers. It's quick & easy.

xsltProcessor: Replacement for xslt_set_base()?

P: n/a
So I'm using the xsltProcessor class in PHP5, and I'm looking for a way
to set the base directory for included XSLT files. This used to be
xslt_set_base() but clearly that's not an option any more.

I've tried using xsltProcessor::setParameter() but while it works (ie.
the param is available in the XSLT) I don't know how to use this in the
<xsl:include...> tag.

Any suggestions gratefully received.

Stickman

Jun 28 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
There is no equivalent in PHP5. The URI of each include file may be relative
or absolute. It is it relative it is assumed to be relative to the base
document (the stylesheet). Refer to http://www.w3.org/TR/xslt#include

--
Tony Marston

http://www.tonymarston.net
http://www.radicore.org

<ma*******@gmail.com> wrote in message
news:11**********************@75g2000cwc.googlegro ups.com...
So I'm using the xsltProcessor class in PHP5, and I'm looking for a way
to set the base directory for included XSLT files. This used to be
xslt_set_base() but clearly that's not an option any more.

I've tried using xsltProcessor::setParameter() but while it works (ie.
the param is available in the XSLT) I don't know how to use this in the
<xsl:include...> tag.

Any suggestions gratefully received.

Stickman

Jun 28 '06 #2

P: n/a
> There is no equivalent in PHP5.

OK, thanks for the clarification.
The URI of each include file may be relative
or absolute. It is it relative it is assumed to be relative to the base
document (the stylesheet).


If only that were the case! As far as I can tell, for the initial XSLT
file the path for includes is relative to the PHP script that calls it.
However, for subsequent includes the path is relative to the including
file.

Am I doing something wrong? Is there any way I can change this
behaviour?

Thanks once again for your help.

Stickman

Jun 29 '06 #3

P: n/a

<ma*******@gmail.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...
There is no equivalent in PHP5.


OK, thanks for the clarification.
The URI of each include file may be relative
or absolute. It is it relative it is assumed to be relative to the base
document (the stylesheet).


If only that were the case! As far as I can tell, for the initial XSLT
file the path for includes is relative to the PHP script that calls it.
However, for subsequent includes the path is relative to the including
file.


That sounds very strange to me. I keep all my XSL stylesheets and include
files in the same directory, and each stylesheet specifies each include file
as a simple file name wihout any directory specifications, so it is always
the same directory. As my PHP script is running in a different direcory to
the XSL styesheet, the URI in the stylesheet is relative to the location of
the stylesheet, not the PHP script.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
Jun 29 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.