如何在 xquery 中的每个 for 循环迭代中找到下一个索引的值

问题描述 投票:0回答:0
 xquery version "1.0-ml";
 import module namespace admin = "http://marklogic.com/xdmp/admin" 
 at "/MarkLogic/admin.xqy";
 declare variable $totalhosts := xdmp:host-name(xdmp:group- 
 hosts(xdmp:group()));

 for $h in $totalhosts
 let $ind := fn:index-of($h, 2)
  return $h[$ind]

如果我在某处输入代码

let $ind :=2

然后我

return $h[$ind]
它应该返回值
index ind=2

请帮助我该怎么做

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