我对 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 /模块/随机
我认为这可能是一个 zorba 问题,但对于 w3 和 expath 命名空间,我也遇到了同样的错误。
更新:我正在使用 Mac OS X 10.8 顺便说一句