I'm having some issues with finding the position of a value in a for
loop. My query is complex so I can't write it in an example here (at
least for the moment). I think the XQuery optimizer messes up with it.
The result I get from the for loop is something like this for every
<element>2113 - 11953 - 8760</element>
where 2113 is the stuck $pos, 11953 is the count $count, and 8760 is the
number of values in the sequence I'm looping on.
Any Ideas? Can I disable part of the optimizer and see if that is the
p.s1 I'm already using declare option db:inlinelimit '0'; because I've
noticed some time ago it helps with compiling the XQuery files (without
this, I have cases of very slow or freezing compilations).
p.s2 I've also had issues this with Saxon involving $pos.