This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Parameter in "xsl:include"
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Parameter in "xsl:include"
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 29 Mar 2001 15:17:02 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> Similar to Martin's question a month back, I want to use an
> external parameter/variable in an <xsl:include>. The
> difference is that each time the stylesheet is used, the
> parameter _may_ be different.
Lots of people want to do this, and you can't. xsl:include is a compile time
thing: you can't build a stylesheet that varies depending on its data, any
more than you can build a Java program that depends on its data.
There are a number of possible alternatives.
- select the stylesheet you want to use from a range of possible
stylesheets, and have this import shared stylesheet modules, rather than
starting with a general purpose stylesheet and having this select a
special-purpose one.
- use modes to control which sets of template rules are active
- do a multi-phase transformation, controlled from the processor's API, in
which the first phase makes decisions about which stylesheets to use for
subsequent phases.
Mike Kay
Software AG
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list