[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: importing/including a stylesheet with a dynamic na
> 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. While I agree with these facts (they had never occured to me, so thank you) I have a case where a conditional import is necessary. I have an application where I need to separate layout from style. Typically I'd use CSS to handle style, except for a few things. First, not all my targets are CSS compliant (AvantGo for instance is a light version of HTML3.2 or something). Second my styles include a lot of information that isn't CSS, or require CSS 2 which most commercial browsers (IE) don't support. Typically we use our style docs (which we call skins) for branding details like logos and the like. Because my skins are destination agnostic and my layouts are branding agnostic, I need to be able to transform foo.xml using layoutx.xsl and skinz.xsl. Currently we use quasi XSL documents for the layout and the skin, pass them through compiling XSL to create the actual transform that we would apply. Since running transforms on the fly is costly compared to storing every possible combination of layout and skin, we compile all our transform ahead of time. I've thought about allowing the layout to specify which skins could be valid (that is load them all) and then use parameters to selectively call particular skins. This gets rather gruesome if I have a template that could concievable use all skins. Adam XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|