[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: "Vladimir Nesterovsky" <vladimir@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 30 Aug 2008 18:08:57 +0300
Re:  use-when in the xsl:inlcude
And again I ask, have you tried this to see if it does in fact work for you?

I've tried it (in Saxon), and it does not work. The error message is:

FODC0002: Exception thrown by URIResolver:
No external documents are available within an
use-when expression

Thanks.
--
Vladimir Nesterovsky
http://www.nesterovsky-bros.com


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

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...

As you might understand, I have some configuration defining xslt to run. E.g. Andrew has proposed to define all required compositions.

Sorry, I'm not sure what you mean by that. I was not following the earlier thread and I thought only to help when I saw inappropriate use of XSLT in your post.


I was thinking of conditional xsl:include.

Yes, I can see that because you are using:


<xsl:include href="" use-when=""/>

This has nothing in common with source input tree during transformation.

But in fact it does very much have something in common because the document() and doc() functions are responsible for building source node trees. As I said before, the stylesheet must be fully realized *before* any access to any source node tree.


This works (if I'm not wrong), as doc() function is available
in the context where values of @use-when are evaluated.
See http://www.w3.org/TR/xslt20/#conditional-inclusion.

Allow me to quote an important sentence from your citation of section 3.12:


  "However, there are severe constraints on the information provided in
   its evaluation context. These constraints are designed to ensure that
   the expression can be evaluated at the earliest possible stage of
   stylesheet processing, without any dependency on information contained
   in the stylesheet itself or in any source document."

I'm quite confident your proposal will not work as the doc() function is *not* available in the context where values of use-when= are evaluated.

Sorry, if I was not clear about the problem I was asking about.

I apologize if I do not understand some nuance you are trying to relate that is not refuted by my reading of the specification. I am trying to help you here.


And again I ask, have you tried this to see if it does in fact work for you?

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.