Re: [xsl] The output of evaluating an XSLT transform is the same regardless of the order in which output elements are evaluated. Right?

Subject: Re: [xsl] The output of evaluating an XSLT transform is the same regardless of the order in which output elements are evaluated. Right?
From: Bill Michell <bill.michell@xxxxxxxxxxxxxx>
Date: Tue, 13 Apr 2010 13:26:37 +0100
On 13 Apr 2010, at 13:15, Costello, Roger L. wrote:

> Ken Holman wrote:
>
>> I'm curious:  why is the "how" important?  I work with these
>> technologies every day and I don't care *how* the processor fulfills
>> the spec, as long as the spec is fulfilled.  A stylesheet writer's
>> responsibility is to understand how the specification works.
>
> Here are a couple answers:
>
> 1. I have a "gut feeling" that if I understand _why_ an XSLT document can be
executed in parallel then it will help me write better XSLT documents.

The intention of XSLT is that it doesn't generate any side effects. The result
of any section of the document should depend only on its inputs, and the only
output should be the obvious one. Read up on
http://en.wikipedia.org/wiki/Functional_programming for some insight.

Of course, it *is* possible to write extension functions that do have
side-effects. But this should really only be done mindfully, and in full
knowledge of the consequences. And then only if you don't mind the output of
your transformation being non-deterministic...

>
> 2. I am trying to shift from an imperative mindset to a declarative mindset.
I have always written XSLT in terms of sequential, step-by-step processing.
The declarative mindset invites me to break out of that way of thinking, into
a more parallel mode of thinking. I want to stop doing FORTRAN in XSLT.
Understanding how things can be done in parallel will help me ... I think.

Think like this: for a given (portion of) the input, what do you want the
output to be?

The XSLT processor will then deal with making that happen. How it does it is
up to it.

>
> /Roger
>

--
Bill Michell
billmichell@xxxxxxxxx

Current Thread