previous  next

FLWOR (general case)

for $i in $is, $j in F($i)
order by f($i,$j)
return g($i,$j)
let $tuples := (
 for $i at $ip in $is,
 $j at $jp in F($i)
 return
 encode($ip,$jp) )
return

 for $z in $tuples
 let $indexes:=decode($z)
 let $ip:=$indexes[1]
 let $i:= $is[$ip]
 let $jp:=$indexes[2]
 let $j:= (F($i))[$jp]
 order by f($i,$j)
 return g($i,$j)

encode: codepoints-to-string(($x1+32,$x2+32,...))
decode: for $i in string-to-codepoints(.) return($i - 32)