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

Re: Conditinally including an XSL module


Subject: Re: Conditinally including an XSL module
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 19 Jul 2000 10:51:50 -0700 (PDT)

> So what's the underlying requirement that people would like a "run-time
> include" to satisfy? Presumably it's to have a different set of template
> rules depending on what you find in the source document, and perhaps to have
> different sets of template rules in force at different times. 

Yes, for me it's partly a desire to not have to change my XML to contain all
the parameters necessary for the stylesheet to do relatively complex node
selection and template matching. "Apply this template when these 5 conditions
are met" kind of thing. It's also partly a desire to cut down the size of the
stylesheet. I don't want to have the overhead of loading 150 templates if I
know that for a given XML I'm only ever going to need 15 of them.

This is especially relevant when I want to create one stylesheet for multiple
customers, where each customer gets a core set of templates plus a set of
customer-specific templates that need to not be conflicting with other
customers' templates. 

I can load up my source trees with extra data or pass in parameters that make
it possible to know which customer I'm dealing with, and just have complex
matching and selection, but that's just a workaround for the fact that I
can't just pull in only the templates I know I'll need.

> That looks rather like an extension of the "mode" concept, with the ability
> to select the processing mode dynamically, and to make it "sticky". Perhaps
> even to set the default mode, so that <xsl:apply-templates/> will only look
> for rules with "mode='xyz'". Am I right?

Yeah, pretty much, although you're still loading up more templates than
you need.

-Mike B.


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



Current Thread
Keywords
xml