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: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 13 Apr 2010 19:49:22 +0100
> Not necessarily true. The evaluation of
> 
> f(g(x))
> 
> requires that g(x) be evaluated, before f()  can be evaluated.
> 

Quite. A better way of expressing the rule would be "the order of evaluation
of a set of expressions is constrained only by the functional dependencies
that exist among the expressions, and the functional dependencies can always
be statically determined."

(But in reality there are further complications. Consider string-join(f(),
g()). Saxon doesn't evaluate g() at all unless f() is a sequence of length 2
or more. So there appears to be a functional dependency from static
analysis, but it's actually a conditional dependency.)

Regards,

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

Current Thread