xsl-list
[Top] [All Lists]

Re: [xsl] Conditional Include statements

2009-03-31 03:14:50
At 2009-03-31 12:14 +0530, Mukul Gandhi wrote:
On Tue, Mar 31, 2009 at 11:23 AM, Tony Rowe 
<tony(_dot_)rowe(_at_)listech(_dot_)com(_dot_)au> wrote:
> <xsl:include href="HLP xxx.xslt"/>
> ...
>
> But is it possible that I can put this include statement within a Template match, based upon some variable value?

xsl:include can only be specified as a direct child of xsl:stylesheet
element (please, see http://www.w3.org/TR/xslt#include. "The
xsl:include element is only allowed as a top-level element.")

Further to Mukul's correct answer, even if it were allowed below the top level all included and imported stylesheets are assimilated into the operation tree before the processor even looks at the source tree. This is because the processor doesn't know everything about the stylesheet's intentions for the source tree until all of the stylesheet fragments are accessed.

Thus, there would be no way to inspect a variable or do anything at all with the operation tree at the time of performing the includes or imports.

I hope this helps.

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


--
XSLT/XSL-FO/XQuery training in Los Angeles (New dates!) 2009-06-08
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>