xsl-list
[Top] [All Lists]

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

2010-04-16 15:34:11
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(_at_)mitre(_dot_)org> 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:

  1. Sequential ordering due to the language specification.

  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

  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.

  <xsl:choose>
     <xsl:when test="evaluate me first">
       ...
     </xsl:when>
     <xsl:when test="evaluate me second (if the first test failed)">
       ...
     </xsl:when>
  </xsl:choose>


  EXAMPLE #2

-- need another example --


EXAMPLES OF SEQUENTIAL ORDERING DUE TO LOGICAL DEPENDENCIES OF CONSTRUCTS IN 
THE XSLT CODE

  EXAMPLE #1

A variable can be used only _after_ it's been initialized, e.g.,

  <xsl:variable name="number" select="ex:Square(4)" />

  <xsl:value-of select="$number" />

The <xsl:value-of> element must be evaluated only _after_ the <xsl:variable> 
element has been evaluated.


  EXAMPLE #2

In this example the sum() function must be evaluated before the 
multiplication occurs:

  <xsl:value-of select="sum(Cost) * 1.2" />


Are there other factors which cause sequential ordering of execution?

/Roger



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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