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

Re: use-when in the xsl:inlcude

Subject: Re: use-when in the xsl:inlcude
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 Aug 2008 07:39:39 -0400
Re:  use-when in the xsl:inlcude
At 2008-08-30 12:49 +0300, Vladimir Nesterovsky wrote:
Is there something I can pass to xslt for it to evaluate that something in the use-when attribute in the xsl:inlcude, and xsl:import?
In particular I'm using saxon in java.

I think I have found a clean way to achieve the desired effect.
I'll define an uri resolver that among others will resolve uri like "configuration:data".


Thus I can write:

<xsl:include href="..." use-when="document('configuration:data')/data/xs:boolean(@xxx)"/>

I guess, this approach has a virtue to be almost processor independent.

Except that it won't work. Your use-when= above relies on *some* document context in order to determine the argument values for the document() function, but as I mentioned earlier all use-when= processing *must* happen before any input source tree is loaded. After all, there may be some top-level instructions in the imported stylesheet tree that impact on the source node tree.


So, in summary, the document() function cannot be used because it is *not* independent of the source node tree ... it needs to be executed in *some* source node tree context and there is no source node tree when the processor acts on use-when=.

I'm quite confident your proposed approach will not work ... you say you found it, but have you tried it?

I hope this helps.

. . . . . . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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-2007 All Rights Reserved.