RE: [xsl] importing/including a stylesheet with a dynamic name (can't)

Subject: RE: [xsl] importing/including a stylesheet with a dynamic name (can't)
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Tue, 30 Jan 2001 21:05:47 -0000
> It seems that there is no way to dynamically import or include another
> stylesheet, unless one writes the calling stylesheet at runtime.

Correct, xsl:include and xsl:import are compile-time facilities.

> More concretely, I am trying to create a sheet that uses a default
> stylesheet for a portion of an HTML document, but I want that
> portion to be able to be replaced by a user simply specifying
> an alternate stylesheet source in the source XML of the translation.

The desire for run-time xsl:import is voiced quite often, and for once it's
nice to hear exactly why you want it, so that I can tell you why you don't!

Instead of A conditionally importing stylesheet B1, B2, or B3 each of which
replaces part of A, the user should select stylesheet B1, B2, or B3, each of
which imports the fixed stylesheet A and replaces or overrides parts of it.
The special-case stylesheet should import the general-case stylesheet, not
the other way around.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread