Q: Relative paths in xsl:import Was: [xsl] Parameter in "xsl:include"

Subject: Q: Relative paths in xsl:import Was: [xsl] Parameter in "xsl:include"
From: Teppo Peltonen <teppo.peltonen@xxxxxx>
Date: 03 Apr 2001 12:57:10 +0300
"Michael Kay" <mhkay@xxxxxxxxxxxx> writes:

> Lots of people want to do this, and you can't. xsl:include is a
> compile time thing: you can't build a stylesheet that varies
> depending on its data, any more than you can build a Java program
> that depends on its data.

Sorry, some might find that comparison a bit confusing, because Java
programs most definately can load classes by name while running. This
would be the equivalent of passing the url of the imported style sheet
as an xpath expression to xsl:import, which doesn't work as you just

Now that I got started, I might as well ask a question ;-)

Is there any practical way to give a "relative" location in the
xsl:import's href attribute? As far as I can understand, the current
working directory during the compilation of the style sheet can not be
known beforehand. Therefore, relative paths can not be used. However,
if I need to compile the stylesheet on some arbitrary environment, I
can not use absolute file locations.

This is all very confusing ;-/ Anyone care to comment on that?

For now, all my imported style sheets have been hardcoded to reside on

XML entities, maybe?

> Mike Kay

Thank you very much,


Teppo Peltonen <mailto:teppo.peltonen@xxxxxx>     phone 09 4566080
VTT Information Technology                        mobile 040 5651878
Tekniikantie 4 B, P.O.Box 1201, Espoo 02044 VTT   telefax 09 4567052

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread