473,387 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Jun 28 '06 #1
3 1812
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
> 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

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul Miller | last post by:
We've run into minidom's inabilty to handle large (20+MB) XML files, and need a replacement that can handle it. Unfortunately, we're pretty dependent on a DOM, so a pulldom or SAX replacement is...
53
by: Kerberos | last post by:
I followed Dan Cederholm's image replacement tutorial, to replace a header tag by a logo. The h1 is clickable if no CSS is applied but it I replace it by the logo, the area isn't clickable anymore...
3
by: Vibha Tripathi | last post by:
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject)...
2
by: brian | last post by:
Hi, before coming to .NET, I utilized regular expressions mostly in JScript / JavaScript and also in my favorite text editor: TextPad (www.textpad.com) I don't know about JScript/JavaScript, but...
20
by: Paul D. Boyle | last post by:
Hi all, There was a recent thread in this group which talked about the shortcomings of fgets(). I decided to try my hand at writing a replacement for fgets() using fgetc() and realloc() to read...
3
by: Jeffrey D. Gordon | last post by:
I'm wanting to replace Field Values in an existing PDF, I've done this with PHP by doing a replace in the file. I've been able to read the file in a byte array in c# but all my attempts to...
1
by: lawrence k | last post by:
Want to replace the limit clause in a query, but can't get it right. What's wrong with this: $pattern = "(.*)limit (.*)"; $replacement = '$1'; $replacement .= "LIMIT $limit"; $replacement .=...
3
by: =?Utf-8?B?RHVrZSAoQU4yNDcp?= | last post by:
I've added a web deployment project and want to use the config section replacement but I'm obviously not understanding something. I have set up an alternate appSettings file,...
5
by: phpbilder | last post by:
dear friends, i am using visual studio php from jcx software (version 5.2.5) and apache from apache friends.com (version 1.6.6a), now i am trying to transform a xml document to a xsl...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.