Re: [xsl] xsl:include href - relative to document root?

Subject: Re: [xsl] xsl:include href - relative to document root?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 21 Jun 2005 15:32:47 +0100
> file relative to
> the webserver's document root?  From the documentation I've read
> it seems that the only way the href can be specified is either
> 
>   1. absolute - which for us means starting with a drive letter and
>                          continuing with a path to the file, or

The href is a normal URI so if it starts with / it is still a relative
URI and it will be taken from the root of the base URI of the current
stylesheet that contains the xsl:include statement. If this was loaded
from the filesystem then the href URI willbe taken relative to that. If
the current stylesheet has been loaded from an http address the same will
be true of the included stylesheet.

You can always (subject to any permission settings on your local setup)
use a full absolute URI http://a/b/c.xsl to load the included file from
anywhere on the internet.

>   2. relative - starting with "../" assuming the current position is
>                       the directory where the xsl file being rendered

If you start with ../ then of it starts in the parent directory of the
current stylesheet rather than the directory in which the stylesheet is
located, but yes any relative path such as href="zzz.xsl" will be
resolved relative to the base URI of the current stylesheet.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread