Re: [xsl] Modularization of XSL stylesheets

Subject: Re: [xsl] Modularization of XSL stylesheets
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 12 Jul 2005 13:19:45 -0400
Hi Sylvain,

At 04:07 AM 7/12/2005, you wrote:
My app structure will look like this (more or less):

/
/modules
/modules/news
/modules/books

Each module has its own XSL stylesheet defining the block it represents, meaning the template starts with a <div> element.

At the root there is a stylesheet that defines the html elements : <html><head /><body /></html>

I'd like to be able to include my modules stylesheet within the <body> element at runtime.

One real simple way would be to import all my XSL stylesheets in my main stylesheet and simply do some apply-template I suppose, but I wondered If there would be a way to avoid having to import all my stylesheets and simply include the right blocks depending on what the user asked to view.

Hmm... now that I read my message back again, I think I misunderstand something here... and the fact I can't be really clear means I miss something :/

No, it's clear enough ... it's hard to get your head around though because in effect what you're asking is that your stylesheets be compiled and run only conditionally. This is a tall order: "dynamic imports", which is a FAQ.


When it's absolutely necessary, this kind of thing can sometimes be achieved by having stylesheets write stylesheets, but it's often not as necessary as people think.

Generally the pros will tell you not to try to do this kind of thing unless you know you really need a feature like this -- it won't necessarily save you any time.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

Current Thread