Re: [xsl] xsl:import

Subject: Re: [xsl] xsl:import
From: "Dave Pawson dave.pawson@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 23 Jul 2017 12:58:13 -0000
First plus I've come across for 3.0 Mike...
I've not seen a reason to move yet.
  Question. Same way as 2.0 using 1.0 stylesheet, does it just warn me and
work?

Regards

On 23 July 2017 at 13:50, Michael Kay mike@xxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> 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
>>
>



--
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk

Current Thread