[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|