The value of a positional variable may be destroyed if
the FLWOR contains an "order by" clause, e.g.
for $x at $i in (2, 1)
order by $x
return ($i, $x)
This returns (2, 1, 2, 2), i.e. always the maximum
value of the positional variable.
Logged In: YES
This appears to be a duplicate of 1185249.
As requested (loudly) on the "Submit New Bug" page, please
don't raise suspected bugs by this route, because it leads
to clutter for people searching the list. Raise them on
saxon-help list or forum in the first instance.