Exiting a for loop in the middle of iteration in XQuery
Hi,
I have below xquery block:
<Root>
{
for $line in $body/input/item
if($line eq "E") then (
return "1"
)
else("0")
}
</Root>
My task here is I have to iterate through all the line items and if I encounter "E" even in single case I have to exit imediately the for loop by returning "1", if it is not "E" for all the line items then at the end I shud return "0"
Here I'm not able to exit the for loop. Do we have any predefined keyword for exiting the loop?
Thanks in advance.