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

Re: Resolving xsl:import href on different base URIs

Subject: Re: Resolving xsl:import href on different base URIs
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 3 Nov 2020 22:42:56 -0000
Re:  Resolving xsl:import href on different base URIs
On 03.11.2020 23:36, Martynas JuseviD
ius martynas@xxxxxxxxxxxxx wrote:

I have a stylesheet that I want to deploy on different setups that
have different base URIs. That impacts the relative URI of the imports
of that stylesheet. For example, in one case

<xsl:import href="../../../xsl/bootstrap/2.3.2/layout.xsl"/>

and in the other case

<xsl:import

href="../../../../static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/layo
ut.xsl"/>

The rest is identical. I'd like to avoid having to duplicate stylesheets just because of this URI difference.

Is there some clever URI resolution trick I'm not seeing, or some XSLT
3.0 static features that can help here?

You could try to declare a static parameter defining the setup and use either a shadow attribute with

  _href="{if ($setup = 'layout1') then
'../../../xsl/bootstrap/2.3.2/layout.xsl' else
'../../../../static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/layout.xs
l'"

I think or use xsl:use-when checking the param on the xsl:imports.

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.