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

Re: xsl:import

Subject: Re: xsl:import
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 Jul 2017 12:50:13 -0000
Re:  xsl:import
In XSLT 3.0 you can do this with static variables/parameters:

<xsl:param name="disk" static="yes" required="yes">

<xsl:import _href="{$disk}/path"/>

Note the underscore. This is referred to as a "shadow attribute" - it is
evaluated at preprocessing time (like use-when). The value of the static
parameter $disk must be available at compile time. In this example I've made
it required, but you can give it a default if you want, and make it optional.

It can't be done in 2.0 unless you implement your own preprocessor.

Michael Kay
Saxonica

> On 23 Jul 2017, at 13:03, Dave Pawson dave.pawson@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> AFAICT I can't use a variable inside an import?
>
> <xsl:import href="{$disk}/path"/>
>
> I'm running with all xsl files on a HDD (currently XXX)
> and know I'll change it to YYY in a year or so.
>
> Is there any way to use the above syntax?
> I.e. prefix the 'disk' to a given path?
>
> Relative paths are an option (but messy in my case)
>
> TiA
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk

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.