[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 16 Apr 2010 13:33:25 -0700

> Are there other factors which cause sequential ordering of execution?

Yes, one very important factor: the data structures involved. More
specifically, for XSLT, the structure of the XML document that is
being processed.


Given the following source XML  document and a data-driven (push
style) XSLT transformation:

<a1>
 <a2>
   <a3>
     <a4/>
   </a3>
 </a2>
</a1>

then the start of processing <a{N}> will be after the start of
processing of <a{N-1}>.

To be even more specific, imagine that the XSLT transformation is very
simple: just the identity rule.



There are data structures, that by definition impose sequential
processing -- some of them very fundamental like the List data
structure. More generally, anything isomorphic to a stuffed Matrioshka
doll requires sequential access to any inner doll in it.



--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play




On Fri, Apr 16, 2010 at 12:33 PM, Costello, Roger L. <costello@xxxxxxxxx>
wrote:
> Hi Folks,
>
> I'd like to flip the discussion around and discuss what factors cause
sequential processing of XSLT programs (i.e., inhibit parallel processing).
>
> From MSM's message I learned that there are two factors which cause a
sequential order of execution:
>
> B  1. Sequential ordering due to the language specification.
>
> B  2. Sequential ordering due to logical dependencies of constructs in the
code.
>
>
> I want to be sure that I understand what these mean.
>
> Below are examples of each. Do you agree with them? Would you provide
additional examples please?
>
> EXAMPLES OF SEQUENTIAL ORDERING DUE TO THE XSLT SPECIFICATION
>
> B  EXAMPLE #1
>
> In an <xsl:choose> element the first <xsl:when> element must be evaluated
before the following <xsl:when> elements and the <xsl:otherwise> element, if
present.
>
> B  <xsl:choose>
> B  B  B <xsl:when test="evaluate me first">
> B  B  B  B ...
> B  B  B </xsl:when>
> B  B  B <xsl:when test="evaluate me second (if the first test failed)">
> B  B  B  B ...
> B  B  B </xsl:when>
> B  </xsl:choose>
>
>
> B  EXAMPLE #2
>
> -- need another example --
>
>
> EXAMPLES OF SEQUENTIAL ORDERING DUE TO LOGICAL DEPENDENCIES OF CONSTRUCTS IN
THE XSLT CODE
>
> B  EXAMPLE #1
>
> A variable can be used only _after_ it's been initialized, e.g.,
>
> B  <xsl:variable name="number" select="ex:Square(4)" />
>
> B  <xsl:value-of select="$number" />
>
> The <xsl:value-of> element must be evaluated only _after_ the <xsl:variable>
element has been evaluated.
>
>
> B  EXAMPLE #2
>
> In this example the sum() function must be evaluated before the
multiplication occurs:
>
> B  <xsl:value-of select="sum(Cost) * 1.2" />
>
>
> Are there other factors which cause sequential ordering of execution?
>
> /Roger


Current Thread
Keywords