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

时间:2013-01-09 16:52:33

标签: xquery

有谁能告诉我为什么第一个xquery返回所需的结果,但第二个没有返回任何内容?在我看来,它们完全相同。

查询1)

for $current-record-eids in collection( "EBOOK-AUTO" )
return $current-record-eids

查询2)

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

1 个答案:

答案 0 :(得分:2)

您不需要在函数调用中使用Attribute Value Templates。只需将值传递为普通参数:

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