Michael Kay
It helps to think about these problems if you understand the processing
model. <xsl:for-each> isn't a loop: it's a function mapping. It says that in
the output you want one Y for every X that appears in the input. Since it's
not a loop, jumping out of it doesn't make sense. What you need is a
different function.
There are a number of places in the XSLT spec where the semantics are
explained using a sequential processing model, however, the language has
been carefully designed so that implementations do not have to follow this
sequential mechanism: it is there purely as a way of explaining the effect
of the language. Not an ideal situation, but it doesn't alter the fact that
the underlying semantics are functional rather than sequential. |