This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Q: Relative paths in xsl:import Was: Parameter in "xsl:include"
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Q: Relative paths in xsl:import Was: [xsl] Parameter in "xsl:include"
- From: Teppo Peltonen <teppo dot peltonen at vtt dot fi>
- Date: 03 Apr 2001 12:57:10 +0300
- References: <000901c0b85a$edaa9200$0c2f3c3e@PCUKMKA>
- Reply-To: xsl-list at lists dot mulberrytech dot com
"Michael Kay" <mhkay@iclway.co.uk> 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
said.
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
http://localhost/foo/bar/xslt/.
XML entities, maybe?
> Mike Kay
Thank you very much,
Teppo
--
Teppo Peltonen <mailto:teppo.peltonen@vtt.fi> 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