Re: [xsl] Design approaches to separating "pure" code from "impure" code?

Subject: Re: [xsl] Design approaches to separating "pure" code from "impure" code?
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 May 2011 09:53:49 -0400
At 2011-05-19 09:45 -0400, Costello, Roger L. wrote:
Hi Folks,

This is a general design question.

First, let me define some terms:

I define "pure" code as code that doesn't do any I/O.

I define "impure" code as code that does I/O.

(Dimitre could probably provide better definitions of those terms)

I am seeking your suggestions on ways to organize XSLT code to keep pure code and impure code separate.

How about a "pure" (your definition) module has no match patterns (input) and no literal result elements (output)?


It is useful to create modules that have no match patterns or literal result elements, especially for re-use. For example, generated text building or common calculations when doing publishing for multiple output formats. When you keep the literal result elements out of the common code, you can re-use the common code regardless of the result. Sounds obvious when written out, but I consciously will decide that a "common module" has only generated text and no literal result elements.

I hope this helps.

. . . . . . . . . . . . Ken

--
Contact us for world-wide XML consulting & instructor-led training
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread