How-to break a for-each loop in XSLT?

后端 未结 6 1963
死守一世寂寞
死守一世寂寞 2020-12-03 13:52

How-to break a for-each loop in XSLT?

6条回答
  •  旧时难觅i
    2020-12-03 14:22

    XSLT is written in a very functional style, and in this style there is no equivalent of a break statement. What you can do is something like this:

    
        
            ...body of loop...
        
    
    

    That way the for-each will still iterate through all the nodes, but the body of the loop will only be executed if the condition is true.

提交回复
热议问题