Connecting Tech Pros Worldwide Help | Site Map

xsltProcessor: Replacement for xslt_set_base()?

 
LinkBack Thread Tools Search this Thread
  #1  
Old June 28th, 2006, 01:55 PM
man.stick@gmail.com
Guest
 
Posts: n/a
Default xsltProcessor: Replacement for xslt_set_base()?

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


  #2  
Old June 28th, 2006, 07:35 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: xsltProcessor: Replacement for xslt_set_base()?

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



<man.stick@gmail.com> wrote in message
news:1151503208.677035.315000@75g2000cwc.googlegro ups.com...[color=blue]
> 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
>[/color]


  #3  
Old June 29th, 2006, 08:35 AM
man.stick@gmail.com
Guest
 
Posts: n/a
Default Re: xsltProcessor: Replacement for xslt_set_base()?

> There is no equivalent in PHP5.

OK, thanks for the clarification.
[color=blue]
> 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).[/color]

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

  #4  
Old June 29th, 2006, 04:15 PM
Tony Marston
Guest
 
Posts: n/a
Default Re: xsltProcessor: Replacement for xslt_set_base()?


<man.stick@gmail.com> wrote in message
news:1151570280.261208.185840@d56g2000cwd.googlegr oups.com...[color=blue][color=green]
>> There is no equivalent in PHP5.[/color]
>
> OK, thanks for the clarification.
>[color=green]
>> 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).[/color]
>
> 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.[/color]

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


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.