用于调用 XQuery 文件的 HTML 表单

发布于 2024-12-18 10:03:30 字数 319 浏览 3 评论 0原文

我们在几个文件夹中有相当多的 .xqy 文件。

有时,我需要调用 .xqy 文件(通过 Marklogic 的 CQ)来测试它是否正常工作。

但我发现必须知道要传入哪些参数并在 CQ 的 xquery 中指定它们相当麻烦。

有没有一种工具可以生成一个 HTML 表单,向我呈现给定 .XQY 文件的参数,并在我按下“提交”按钮时调用它?

如果没有,这里有人知道如何制作这样的 HTML 表单吗?现在,我似乎找不到任何现成的 xdmp 或 xquery 命令来告诉我 .XQY 文件是否可调用或它期望提供哪些参数。

  • 丹尼

We have quite a number of .xqy files in several folders.

Sometimes, I need to invoke an .xqy file (via Marklogic's CQ) to test if it's working.

But I find it rather cumbersome to have to know what parameters to pass in and specify them in the xquery in CQ.

Is there a tool out there that would generate an HTML form that presents to me the parameters of a given .XQY file and invokes it when I press a "submit" button ?

If there is none out there, would somebody here know of how to make such an HTML form ? Right now, I can't seem to find any readily-available xdmp or xquery commands to tell me if an .XQY file is invocable or what parameters it expects to be fed.

  • Danny

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

挽手叙旧 2024-12-25 10:03:30

XQuery 标准不支持内省,MarkLogic 也不提供任何有助于内省的函数。最接近的方法是使用 XQDoc 文档代码,它能够解析 XQuery 代码本身并生成模块内所有函数签名的描述。

您可以在这里找到更多详细信息:http://developer.marklogic.com/code/xqdoc- ws

它不提供“提交”按钮,但使用 xqdoc 的 XML 输出,您可以自己制作。.

祝您好运!

The XQuery standard doesn't support introspection, nor does MarkLogic provide any functions that help with that. The closest you can get with this is using the XQDoc documentation code that is capable of parsing the XQuery code itself and producing descriptions of all function signatures within modules.

You can find more details about it here: http://developer.marklogic.com/code/xqdoc-ws

It doesn't provide a 'Submit' button, but using the XML output of xqdoc, you could make that yourself..

Good luck!

动听の歌 2024-12-25 10:03:30

另一种选择是将 XQuery 转换为 XQueryX,然后您可以使用 XQuery(或 XSLT)将其作为 XML 处理,以生成 XForm 或 XHTML 表单。

Another option would be to convert your XQuery to XQueryX and you can then process this as XML using XQuery (or XSLT) to generate an XForm or XHTML Form.

热血少△年 2024-12-25 10:03:30

由于 Danny 提到了单元测试,我将冒险插入我自己的框架: https://github.com/mblakele/ xqut

我通常在 cq 缓冲区中运行 XQUT 测试套件,但将一个测试套件包装在一个简单的网页中(无论有或没有表单)都很容易。

Since Danny mentioned unit testing, I'll risk plugging my own framework for that: https://github.com/mblakele/xqut

I usually run XQUT test suites in a cq buffer, but it would be easy enough to wrap one in a simple web page - with or without a form.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文