集合()中的参数在xquery中不起作用

集合()中的参数在xquery中不起作用,xquery,Xquery,有人能告诉我为什么第一个xquery返回所需的结果,而第二个xquery什么也不返回吗?在我看来,他们是一模一样的 问题1) 问题2) 您不需要在函数调用中使用。只需像传递普通参数一样传递该值: let $collection as xs:string := "EBOOK-AUTO" for $current-record-eids in collection($collection) return $current-record-eids wst-谢谢!工作得很有魅力。我想我已经试过了

有人能告诉我为什么第一个xquery返回所需的结果,而第二个xquery什么也不返回吗?在我看来,他们是一模一样的

问题1)

问题2)

您不需要在函数调用中使用。只需像传递普通参数一样传递该值:

let $collection as xs:string  := "EBOOK-AUTO"
for $current-record-eids in collection($collection)  
return $current-record-eids

wst-谢谢!工作得很有魅力。我想我已经试过了,但是现在意识到我试过了(“$collection”),而您的解决方案没有双引号。
let $collection as xs:string  := "EBOOK-AUTO"
for $current-record-eids in collection( "{$collection}" )  
return $current-record-eids
let $collection as xs:string  := "EBOOK-AUTO"
for $current-record-eids in collection($collection)  
return $current-record-eids