每次在xquery的for循环中增加索引的位置值

问题描述 投票:0回答:0
 declare variable $eachPhase := 5;
 for $h at $p in $t where $p=1
   return 
   for $f in $phases
    let $f-name := fn:concat($f, "of-phase")
     return
     if ($eachPhase gt 5) then
      $h
    else $h(next value of $h) 

在else部分我想返回h的下一个索引值 假设 $h 变量值是 abc bcd dex

所以在 if 部分它应该返回 $h 是 abc 但在其他部分它应该返回 bcd

如何实现?

xquery
© www.soinside.com 2019 - 2024. All rights reserved.