Multiple variable bindings in one for clause : for « XQuery « XML






Multiple variable bindings in one for clause


File: Query.xquery

for $i in (1, 2), $j in ("a", "b")
return <oneEval>i is {$i} and j is {$j}</oneEval>


Output:

<?xml version="1.0" encoding="UTF-8"?>
<oneEval>i is 1 and j is a</oneEval>
<oneEval>i is 1 and j is b</oneEval>
<oneEval>i is 2 and j is a</oneEval>
<oneEval>i is 2 and j is b</oneEval>

 








Related examples in the same category

1.Multiple for clauses
2.Nested for loop
3.for loop and node text
4.Use for loop
5.for each loop and range
6.for each loop
7.Nested for each loop
8.For each node in certain level
9.For stateCt
10.for and doc() function