File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
main/java/org/basex/query/expr
test/java/org/basex/query/ast Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ public Value value(final QueryContext qc) throws QueryException {
7171 qf .value = item1 ;
7272 final Iter iter2 = exprs [1 ].iter (qc );
7373 for (Item item2 ; (item2 = qc .next (iter2 )) != null ;) vb .add (item2 );
74+ qf .value = qv ;
7475 }
7576 return vb .value (this );
7677 } finally {
Original file line number Diff line number Diff line change @@ -3398,4 +3398,19 @@ private static String gh1852(final String query) {
33983398 query ("let $a := 'x' let $b := if($a) then (<a/>, <b/>) else error() return $b/name()" ,
33993399 "a\n b" );
34003400 }
3401+
3402+ /** DualIterMap context value setting. */
3403+ @ Test public void gh2569 () {
3404+ check ("let $node := <X><A/><B/><C/></X>\n "
3405+ + "let $pos := $node/A ! position()\n "
3406+ + "let $nodes := for $c at $i in $node/* where $i gt $pos return $c\n "
3407+ + "let $flat := $nodes ! (if (*) then * else .)\n "
3408+ + "return element Y {$flat except $flat[1]}" ,
3409+ "<Y><C/></Y>" , exists (DualIterMap .class ));
3410+ check ("let $node := <X><A/><B/><C/></X>\n "
3411+ + "return $node/A ! position()\n "
3412+ + " -> (for $c at $i in $node/* where $i gt . return $c) ! (* otherwise .)\n "
3413+ + " -> element Y {. except head(.)}" ,
3414+ "<Y><C/></Y>" , exists (DualIterMap .class ));
3415+ }
34013416}
You can’t perform that action at this time.
0 commit comments