xsl-list
[Top] [All Lists]

Re: [xsl] Need help with XSLT tokenize

2020-08-13 05:55:45

What about XSLT 3's xsl:iterate? Isn't that, with its parameters that
can change on each iteration step, close to a procedural, sequential loop?

I prefer to think of it as syntactic sugar for a functional fold operation, or 
for a tail-recursive function. It means that processing the Nth item has a 
functional dependency on processing the (N-1)th, but a functional dependency is 
not quite the same as a defined order of execution.

For example, if the code did

<xsl:when test="self::H1">
  <xsl:next-iteration>
    <xsl:with-param name="pos" select="1"/>
  </xsl:next-iteration>
</xsl:when>

then a smart optimizer could work out that processing the item following an H1 
doesn't depend on anything that went before, and could therefore be done in 
parallel with processing of previous items. Unlike a loop, the functional 
depenendency is explicit and it's therefore still possible in principle to 
rearrange the order of execution.

Michael Kay
Saxonica
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>