Re: [xsl] design ideas? exploiting variables

Subject: Re: [xsl] design ideas? exploiting variables
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Tue, 14 Dec 2004 08:24:18 -0800
Michael Kay wrote:
So, my current code is oriented towards xhtml output. But I want to be able to write simple simple output drivers for other formats that just takes the content in the formatted-biblist variable (which is just xhtml) and transforms it (into, for example, TeX or WordML).


There's an interesting design choice that has to be made between using a
single-stylesheet pipeline and a multi-stylesheet pipeline. Generally, the
more complex things get, the more benefits there are in using a
multi-stylesheet pipeline, where the transformation is broken up into a
sequence of small transformations each done by its own stylesheet. The
problem with this approach is that you need to write code in another
language to control the pipeline flow. There are pipeline languages that do
this (XPipe, Orbeon), or you can do it in Java, but it's another bit of
technology to add to the mix.

Once you've got a pipeline of more than one stylesheet, and a decent control
engine for coordinating them, you tend to find that the individual
stylesheets become smaller and smaller, and more and more reusable. Until
you get to that point, you tend to construct a single-stylesheet pipeline in
which variables are used to hold the results of successive transformation
phases: and the stylesheet gradually gets more and more complex.

I don't know what the right answer is for you - I'm just trying to clarify
your options.

Have other people experienced the same dilemma?


Wouldn't a simple solution (in a java servlet container environment) be to use a servlet that is mapped to a file type (based on the extension). Given base XHTML files and a request for *.rss, for example, you could get the corresponding XHTML file and transform it to the RSS structure.

best,
-Rob



Michael Kay http://www.saxonica.com/

Current Thread