[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Is there a neat way to get style-sheet relative p

Subject: RE: Is there a neat way to get style-sheet relative paths?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 19 Jul 2004 13:09:01 +0100
stylesheet relative
XSLT 2.0 would allow you to write

href="{resolve-uri('ReportStyle.css')}"

But of course that doesn't help very much because you need a solution that
works in IE. Unfortunately I don't think it's possible: although the base
URI of a stylesheet instruction is part of the context in 1.0, it's
accessible only through the document() function.

Michael Kay
 

> -----Original Message-----
> From: Harald Brinkmann [mailto:hbbst@xxxxxxx] 
> Sent: 19 July 2004 12:33
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Is there a neat way to get style-sheet relative paths?
> 
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.