Multiple for clauses : for « XQuery « XML






Multiple for clauses



File: Query.xquery

for $i in (1, 2)
for $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 variable bindings in one for clause
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