RE: [xsl] return?

Subject: RE: [xsl] return?
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 27 Nov 2003 10:27:21 +0100
> Hi,
>     Is possible in xslt use a return instruction when some 
> condition occur
>     and stop de verificaction  of  the remaining code
>     like this
>      <xsl:if test="string-length($str) <= 4>
>         (terminate verificaction) <xsl:return /> (?)
> </xsl:if>
> 

You can use <xsl:message terminate="yes"> to abort the whole
transformation, but you can't break out of a loop. That's because it's
undefined what the order of processing for a loop is: it might handle
all the nodes in the supplied node-set in parallel if it's clever
enough.

If you can't select the nodes you actually want to process up-front in
the select expression, then recurse over the nodes instead of iterating
over them.

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread