your code misses a do or collect clause. This should do the trick (and, btw, also answer your question about bach.collect):
Code: Select all
for $a in flat($x1) , $b in right(flat($x1), 1) collect (
if ($a < $b) then ($a + 1)
else $a )
andrea
Code: Select all
for $a in flat($x1) , $b in right(flat($x1), 1) collect (
if ($a < $b) then ($a + 1)
else $a )