how to include the value of position() in an Xquery result?
问题 Without using tumbling windows, how is the position itself included in a result? Obviously "$p" should be the "index" of each $item in $items. That being said, iteration isn't guaranteed to be sequential at all. output: <result> <items> <item pos="$p">5</item> <item pos="$p">3</item> <item pos="$p">7</item> <item pos="$p">2</item> <item pos="$p">7</item> <item pos="$p">3</item> </items> </result> query: xquery version "3.1"; let $items := (5,3,7,2,7,3) return <result> <items> { for $item in