Re: union vs. "or" vs. contains?
2004-10-20 08:44:13
Hi Bruce,
At 08:11 PM 10/19/2004, you wrote:
But this is precisely the advantage of implementing the different
processing pathways by using layered modules (a core module plus a
separate stylesheet "shell" for each processing pathway), rather than
using testing-against-parameters.
Is this your original suggestion, whereby the user must choose the
stylesheet to invoke?
Mm-hmm. Except there are generally various ways you can avoid the user
having to choose. Delegation to the correct stylesheet can be done by a
separate layer.
Whatever I do, I want to keep processing completely controlled by the
configuration file.
Maybe someone on this list who knows Ant better than I do (it's on my
list!) can comment on how Ant (a Java build framework) could query a
configuration file to determine which stylesheet to call when a job is
invoked. A poor man's version of the same (though of course Ant is free)
could use a batch file to run a transform on your config file, to create
another batch file (in which the delegation could be managed), and then
execute it. In other words, these things can be done.
As the primary maintainer, however, only you, however, can determine
whether the extra layer is too high a price to pay for stylesheet code that
is comparatively clean and easy to maintain and extend.
(Personally I don't think it's too much to ask someone to use X stylesheet
if they want X, and Y stylesheet if they want Y, but this isn't my call. :-)
It's not that it can't be done this way; it's just much more cumbersome
and hard to maintain. (Giving XSLT the reputation of being "hard".)
I don't find my current approach at all difficult to make sense of or
maintain, actually; at least not on this count (I get much more confused
with all of the modes, namespaces, and parameters being thrown around!).
It's precisely the proliferation of modes and parameters that this
architecture is designed to mitigate. Namespaces are a different matter....
If the citation-class is implemented as simply a call to a special
'author-year' stylesheet (or whatever), all the templates particular to
that kind of processing can be in that stylesheet, with no variable
testing anywhere at all.
How are you precisely envisioning this? In my ideal world, I'd be able to
choose which files to include based on the parameter, but I guess that's
not possible.
No it's not, although such "dynamic imports" have frequently come up as a
desideratum. Maybe Mike, David or Jeni can remind us of how XSLT 2.0
envisions such things being done.
Cheers,
Wendell
======================================================================
Wendell Piez
mailto:wapiez(_at_)mulberrytech(_dot_)com
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
======================================================================
|
|