2010-11-15 17 views
1

我從撒克遜這個錯誤,的XQuery - 預期回報發現讓

引擎名稱:撒克遜-PE的XQuery 9.2.1.2 嚴重性:致命 說明:#XQuery的語法錯誤...(:返回:)讓$#:預期「收益」,找到「讓」 開始位置:776:0

此功能

declare function local:set-internet-type($req1 as element(ns0:req), $cate as element()) as xs:string { 
    if(count( for $itm in $req/*:cust/*:inter/*:itm 
     where $789/*:product/*:030/*:specs/*:name/text()= data($11/INTERNET) 
     and $22/*:action/text()="CHANGE" 
     return $33)>0) then 
    (
    for $44 in $55 
     where $tt/*:name/text()= data($t/INTERNET) 
    and $u/*:action/text()="CHANGE" 
    (:return <fake/>:) 

    let $z:= $a/*:product/*:c/*:e[1] 

     return concat($x,'>',$y) 
) else ("") 
}; 

我是新使用XQuery和我花了很多關於這個錯誤沒有得到一個解。 Vars被故意掩蓋,但是從錯誤信息看來似乎與功能流有關。

任何幫助表示讚賞。

在此先感謝 亞歷山德羅

回答

1

撒克遜只宣稱有「部分支持的XQuery 1.1」。因此,我猜,它支持舊的FLWOR格式,其中where之後不能使用let。只是嘗試交換這些子句:

for $44 in $55 
let $z:= $a/*:product/*:c/*:e[1] 
where $tt/*:name/text()= data($t/INTERNET) 
    and $u/*:action/text()="CHANGE" 
return concat($x,'>',$y)