[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Dynamically determine which XSLT files to include and import?


Subject: Re: [xsl] Dynamically determine which XSLT files to include and import?
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Mon, 29 Jul 2013 16:46:27 +0100

On 29 July 2013 16:34, Costello, Roger L. <costello@xxxxxxxxx> wrote:
> Hi Folks,
>
> Is there a  way for an XSLT program to, at runtime, decide which XSLT files to include and import?
>
> I imagine something like this at the top of the XSLT program:
>
>     if the input file has value X set then
>         include A.xsl, B.xsl
>     else
>         include C.xsl, D.xsl
>
> Any way to do this?

No, it's not possible.  The typical solution is the "specific imports
common" design where the calling language decides which specific xslt
to run based on X.

However, if X is taken from the source message itself, then you can
just include all the XSLTs and use modes (or other techniques) to
control the processing flow.

-- 
Andrew Welch
http://andrewjwelch.com


Current Thread
Keywords