【问题标题】:target namespace not found for schema/module找不到模式/模块的目标命名空间
【发布时间】:2013-06-23 19:49:51
【问题描述】:

我对 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 的目标命名空间

我认为这可能是一个 zorba 问题,但对于 w3 和 expath 命名空间,我也遇到了同样的错误。

更新:我正在使用 Mac OS X 10.8 顺便说一句

【问题讨论】:

    标签: module namespaces xquery exist-db zorba


    【解决方案1】:

    您不能简单地将 Zorba 模块与 eXist 一起使用。我也不认为 eXist 支持 HTTP 客户端 EXPath 模块。查看您的处理器(eXist 或 Sausalito)的文档并仅使用它们支持的模块。如果它们是内置的,那么您使用的一个简单的import module namespace 应该就足够了,但是,如果您想包含一个通用模块,您还必须在一些依赖于处理器的目录中提供模块源代码。

    对于 eXist,请查看 http://exist-db.org/exist/apps/doc/extensions.xml 以了解如何包含您的模块。 eXist 也有随机函数,但它们是内置在数学模块中的。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-27
    • 2014-02-12
    • 2011-06-26
    • 2013-05-07
    • 2011-09-29
    • 2017-07-13
    • 2021-05-17
    相关资源
    最近更新 更多