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 14:33:37
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>
--~--

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