Re: [xsl] Is there a neat way to get style-sheet relative paths?

Subject: Re: [xsl] Is there a neat way to get style-sheet relative paths?
From: tammy@xxxxxxxxxxx
Date: Mon, 19 Jul 2004 07:57:25 -0400 (EDT)
Hi Harald,

The relative path can be passed in as a parameter where
you would put <xsl:param> after <xsl:stylesheet> but
before <xsl:template>. Since  you are using IE's
embedded xsl transform capability by referencing the
xsl file in <?xsl-stylesheet>, I don't know how or if
it's possible to pass a parameter into the xsl
transform via the url.  It seems like somthing I may
have tried a long time ago, but I couldn't find any
quick references to a syntax like:
   http://www.myserver.com/myxmlfile.xml?param1=../style

Tammy

On Mon, 19 Jul 2004 13:33:17 +0200 (MEST), "Harald
Brinkmann" wrote:

> 
> Hello everyone,
> 
> for display on an IE 6.0 I want to use this directory
> structure:
> 
>   somepath/data/DataFiles.xml
> 
> for xml files containing the data and
> 
>   somepath/style/StyleFiles.xsl
> 
> for the style info to be used.
> 
> The explorer knows about the stylesheet to be used by
> finding a
> 
>   <?xml-stylesheet type="xsl/text"
> href="../style/StyleFiles.xsl"?>
> 
> line in the xml data files. So far, so good.
> Unfortunately some info is
> contained in a css-file and there are image files to
> load as well, which are
> located in the style directory. (I did not want to use
> css, but I could not
> find another way to produce an output media dependent
> style, among other
> things, and I am open to suggestions!) This is how I
> reference the css:
> 
> <xsl:template match="/">
>  <html>
>   <head>
>    ...
>    <link rel="stylesheet" type="text/css"
> href="ReportStyle.css" />
>   </head>
> 
> Obviously this is referenced after the html is
> generated and therefore
> refers to the then current directory. I don't want to
> carry the relative
> path info into the xml-file, other than in the
> stylesheet reference above,
> unless I have to. So, is there a way to somehow use
the
> stylesheet-path, so
> that the href for the css and image includes look in
> the stylesheet
> directory rather than the data directory? I have found
> a way to include
> other xml files located in the style directory by
doing
> 
>   <xsl:variable name="Lang" select="document( $fn,
> document(''))/Terms" />
> 
> but I couldn't figure out if there is way to use this
> for css and image
> files as well.
> 
> Cheers
> 
> Harald Brinkmann

Current Thread