xsl-list
[Top] [All Lists]

Re: splitting a process into passes (was <no subject>)

2003-04-18 08:28:48
Andrew,

My $0.02:

At 09:30 AM 4/18/2003, you wrote:
Is it reasonable or advantageous to create an intermediate XML file that
incorporates new elements/attributes for the calculations so that each of
the ultimate transformations don't need to do these calculations,

I don't know if it is for you, but it certainly can be.

 or is this considered bad form?

By whom? "They" might consider it bad form, but "they" haven't said yet. :->

Actually it seems to me you need to dig deeper to get at what *specific* advantages there are and how they match with your overall requirements (operational, maintenance etc. etc.). Usually in my experience even the most "religious" of technical questions have practical underpinnings, even if only in the sense that "you can do X but you're running the risk of getting burned down the line; Y may cost a bit more but it keeps you safe". (The blurry intermediate zone would have to be questions of aesthetics. I don't know whether you consider a serial pipeline such as you describe to be ugly or not; some people find them rather nice and neat, when well done.)

  This is effectively what I would like to be able to do
in one shot but am having difficulty making it happen.

There are certainly transforms that are much easier to achieve in two or more passes than in one. Also, separating out the logic can be good design practice if only because it helps you break the problem into its natural pieces.

  It seems that I can
lock in the result tree this way, but am interested to hear if this
generates any reaction (positive or negative).

I'm not sure what you mean by "lock in the result tree". My reaction, however, is that assuming there's no real *requirement* to be served by an all-in-one-pass, splitting the logic sounds like a very reasonable idea.

Keep in mind that XSLT also gives you facilities for modularizing stylesheets (xsl:include; xsl:import and xsl:apply-imports), which can help you to design your processing in a modular way even if it is to be executed in one pass.

Final caveat: though I do have some relevant experience, I am not trained professionally as a software architect or an industrial engineer, so consider my advice accordingly: this ain't "book knowledge" I'm offering. (I am confident that those on this list who are so trained will weigh in, when necessary. :-) I do find, however, that you can get a long way by applying simple common sense and keeping your eye on the big picture as well as on the details.

Cheers,
Wendell

___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
    "Thus I make my own use of the telegraph, without consulting
     the directors, like the sparrows, which I perceive use it
     extensively for a perch." -- Thoreau


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>