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

Re: xsl:import and use-when

Subject: Re: xsl:import and use-when
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 15 May 2014 22:40:48 -0000
Re:  xsl:import and use-when
The 2.0 spec says that in the dynamic context for evaluating use-when
expressions, the set of available documents is empty.

The 3.0 spec changes this to say it is implementation-defined.

Michael Kay
Saxonica


On 15 May 2014, at 21:21, Rushforth, Peter peter.rushforth@xxxxxxxxxxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> Hi,
>
> I have been experimenting with xsl:import@use-when to override templates
imported by the main stylesheet module with
> an import@href value (partially) generated by a filtered maven variable.
Because the file so referenced may or may not exist, I've tried
> to apply the @use-when attribute as follows:
>
>  <xsl:import href="feedOrEntry2json-default.xsl"/>
>  <xsl:import href="feedOrEntry2json-api.xsl"
use-when="doc-available('feedOrEntry2json-api.xsl')"/>
>
> The string 'api' is generated by the filtered maven  variable, and the file
does exist in the same directory as the importing stylesheet
> (when I execute the doc-available('feedOrEntry2json-api.xsl') call in the
xpath tester in oxygen, I get 'true' as a result).
>
> However, when I execute the stylesheet, the templates in the first import
are (incorrectly) not overridden.
> If I remove the @use-when, they are (correctly) overridden, but of course I
can't do that in general because sometimes the file won't
> exist and in that case I don't want the compilation to fail, hence the
@use-when.
>
> Any advice appreciated, with thanks.
>
> Peter Rushforth

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.