Re: [xsl] stylesheet expansion

Subject: Re: [xsl] stylesheet expansion
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sat, 08 Dec 2007 11:55:34 +0100
Geert Bormans wrote:
Hi all,

I have a stylesheet with a pipeline in it
and a large set of imported stylesheets (nicely shielded with seperate modes)
imported stylesheets are tested separately, so they all have a template match="/" outside the mode
(hence import instead of include)


I would like to deliver one expanded stylesheet.
Did anyone ever develop an expansion stylesheet (or other program)
or has anyone ever come across such a thing?

I assume you'd want the expanded stylesheet to obey the import precedence rules? It's trivial to concatenate the imports into one stylesheet, of course, but to mimic the import precedence may be daunting, more so because determining the import precedence means dissecting the matches, which I believe is done once matches are found (i.e., when the XML is fed to the stylesheet), not entirely at compile time, because matches can overlap in different ways on different occasions... (but I'm afraid I don't know enough of compiling stylesheets into some internal representation to really assert this).


If you know of one specific set where the precedence is apparent (i.e., only on the / match, and the rest is inside the modes you mention), perhaps an if/when like construct in your main concatenated stylesheet would suffice.

May I ask why you want them all together? It seems to me that separate logical units is a better approach than one big stylesheet.

Cheers,
-- Abel Braaksma

Current Thread