xsl-list
[Top] [All Lists]

RE: return?

2003-11-27 02:27:21
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



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