我對XQuery比較陌生。但是,我對我的問題做了大量的研究,不明白我做錯了什麼。這裏是我的代碼:未找到模式/模塊的目標名稱空間
(: XQuery main module :)
xquery version "3.0" encoding "utf-8";
import schema namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
import module namespace http = "http://expath.org/ns/http-client";
import module namespace rand = "http://www.zorba-xquery.com/modules/random";
declare variable $URL as xs:string :=();
declare variable $AF_Tok as xs:integer := rand:seeded-random-between(23 (:This is the seed, needs to be randomized too, will fix later.:),
0 (:This is the lower bound for every number in the sequence.:),
9 (:This is the higher bound for every number in the sequence.:),
32 (:This is the number of random numbers in the returned sequence:)
);
declare variable $Client_ID as xs:string := ("XXXXX");
declare variable $Client_Secret as xs:string := ("XXXXX");
<test>
<random_number>{$AF_Tok}</random_number>
</test>
我在eXist和Sausalito Tools for Eclipse中都得到相同的錯誤。任何人都可以測試一下,讓我知道如果你也得到錯誤?我很難過,任何幫助將不勝感激。
:6,1:靜態錯誤[ERR:XQST0059]:「http://www.zorba-xquery.com/modules/random」:目標命名空間中找不到的模式/模塊http://www.zorba-xquery.com/modules/random
我認爲這可能是一個左巴的問題,但我得到了同樣的錯誤w3和expath命名空間也是如此。
更新:我使用的是Mac OS X 10.8 BTW
@dirrk我實際上通過將命令更改爲'import module namespace rand = http://www.zorba-xquery.com/modules/random <命名空間的位置>來解決錯誤;' – zg303