问题标签 [zorba]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
517 浏览

module - 找不到模式/模块的目标命名空间

我对 XQuery 比较陌生。但是,我对我的问题进行了大量研究,但不明白我做错了什么。这是我的代码:

我在 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 顺便说一句

0 投票
1 回答
916 浏览

xquery - Update multiple XML files using XQuery and Zorba

Is there a simple way using the Zorba XQuery Processor to update multiple XML files and save the output of the modification back in the same file?

So far I have figured out how to process multiple files using the File module and the file:list extension to find all the XML files in a directory. I then loop through each document and run an XQuery Update statement (replace value of node {} with {}). The problem is that this doesn't actually modify the file.

I was using Saxon before, but the license costs are too expensive for this particular project. In Saxon EE, if I ran a "replace value of node" on an open document, the document would be updated on the disk when the query was finished. I suspect Zorba doesn't work this way, instead only modifying the value in memory during the query. If I was editing one file I would just output the modified XML in Zorba and pipe that back to the input file, but in this case I want to update many files. Is that possible in one query?

Here is what the code looks like:

0 投票
1 回答
2120 浏览

c++ - C ++中的嵌套unordered_maps

我正在将我用 Java 编写的程序重写为 C++。我在使用复杂的数据结构时遇到了很多麻烦:

我花了一段时间,但我最终能够弄清楚如何将“项目”(因为没有更好的词)添加到 unordered_map。但是,我来找你是因为我不知道如何使用 unordered_map::find 检索我放入其中的项目。

我的代码如下:

我给你我目前正在处理的整个文件。当我将 java 代码直接粘贴到我的 c++ ide 中并且只是逐行处理时,出现了很多错误。请关注这行代码:

我应该补充的另一件事是我对 c++ 生疏了,所以如果有比

洗耳恭听。

谢谢你读到这里:)

0 投票
1 回答
243 浏览

c++ - 如何在 C++ 中使用 Zorba

我正在尝试将 Zorba XQuery 解析器与 C++ 一起用于我的项目。我已经下载并安装了 Zorba,但我似乎找不到在我的 C++ 程序中使用它的方法。文档没有说一句话。所以如果这里有人对它有好处,你能把你的两分钱给我吗?

谢谢

0 投票
3 回答
780 浏览

collections - Zorba 集合:xml 文件的简单目录

我有一个 xml 文件目录,我想将其用作集合,特别是查看$my_collection/of/things每个文件的<things>.

我正在使用 Zorba。

这导致error retrieving resource(语法问题?):

variable $my_collection := fn:collection("file://localhost/path/to/my/*.xml");

我还阅读了有关 Zorba 的数据定义工具的文档……对于这个单一的目的来说似乎有点矫枉过正。或不?

0 投票
3 回答
834 浏览

arrays - 消除数组中的重复项 (JSONiq)

我想删除 JSONiq 数组中的重复项。

如何消除 $x 中的重复项?

0 投票
1 回答
115 浏览

xquery - Zorba:从操作系统(xquery-operators)实现的功能?

我想在 Zorba 中使用 xquery-operators 命名空间 ( http://www.w3.org/2002/08/xquery-operators ) 中的函数,特别是 op:add-dayTimeDuration-to-dateTime。

但是我收到一个静态错误:“op:add-dayTimeDuration-to-dateTime”:未声明 arity 2 的函数”。我必须声明 op 命名空间才能到达那一步,所以 Zorba 可能使用了不同的前缀。或者,也许这些功能没有实现。我很难找到这些问题的答案。

谢谢!

0 投票
0 回答
153 浏览

php - 无法在 Windows 7 上使用 PHP 5.5.9 运行 Zorba 3.0

我已经在我的 PC/Windows 7 上下载并安装了 Zorba 3.0。我已经启动并运行了 Apache/2.4.7 和 PHP/5.5.9。我在Zorba的php.ini中也有以下内容:

include_path = ".c:\php\includes"
extension_dir = "C:\PHP\ext"
extension=zorba_api_php.dll

zorba_api_php.dll来自C : \Program Files (x86)\Zorba XQuery Processor 3.0.0\share\php,我将其复制到c:\PHP\ext文件夹。

当我重新启动我的 Apache 服务器时,我在日志中收到以下错误:

PHP 警告:PHP 启动:无法加载动态库 'C:\PHP\ext\zorba_api_php.dll' - 找不到指定的模块。\r\n 在第 0 行的未知中

我通过在 DOS 提示符下运行 zorba.exe 检查了我的 Zorba 安装:

C:>zorba -q 2+1
</code --> 3

它工作正常。

谢谢,

0 投票
1 回答
431 浏览

xml - 模式感知 XQuery

目前我正在使用带有 XQuery 引擎Zorba的 Eclipses XQuery 插件xqdt

我希望 XQuery 引擎“类型检查”我的 XPath 表达式的正确性,例如,如果架构定义视频/视频是允许的,但视频/图片不是,解释器应该警告后一个 XPath 表达式无效。

我尝试遵循Schema-Aware Queries and Stylesheets教程,但我无法让它工作。我的代码示例使用教程中的示例video.xml和示例video.xsd

我的第一个精简示例导致类型错误: import schema default element namespace "" at "videos.xsd";

使用类型,使用 element 而不是 schema-element 不会警告我我拼写错误的 video2 路径并且不会打印任何内容:

问:有人可以为我提供一个 $input/videos/video2 失败的最小工作示例吗?

更新: 我已将命名空间添加到videos.xsdvideos.xml并将导入架构更改为

,但没有成功。

0 投票
1 回答
204 浏览

xml - 如何在 Zorba XQuery 中添加属性?

我有 XML 文档,其根节点名为entity. 对于每个文档,我想用名称计算它有多少个节点tender,并将其作为属性添加到entity.

我关注的是http://exist-db.org/exist/apps/doc/update_ext.xml,这不适合 Zorba,但我猜这是标准的 XQuery。

我得到错误

我究竟做错了什么?