简体   繁体   English

如何从 shell 脚本中调用 marklogic(xqy 文件)的模块?

[英]How to invoke modules of marklogic(xqy files) from shell script?

I want to write a shell script in which I can call a.xqy file and import some namespace also in that shell script.我想编写一个 shell 脚本,我可以在其中调用 a.xqy 文件并在该 shell 脚本中导入一些命名空间。

You can use the REST API and some HTTP aware command line client like curl or wget.您可以使用 REST API 和一些支持 HTTP 的命令行客户端,例如 curl 或 wget。 There are many examples in the REST API's about how to do this, although it is fairly tedious to call.xqy code, pass it input, arguments and get output - possible. REST API 中有很多关于如何执行此操作的示例,尽管 call.xqy 代码相当乏味,将其传递给输入 arguments 并获得 output - 可能。

You can use a program designed to do this such as xmlsh and the marklogic extension http://www.xmlsh.org您可以使用专门为此设计的程序,例如 xmlsh 和 marklogic 扩展http://www.xmlsh.org

Or you can write a 'simple' generic wrapper function in any of the languages which ML has a supported SDK, and then call that from the shell script.或者您可以使用 ML 支持的任何语言编写一个“简单”通用包装器 function SDK,然后从 shell 脚本中调用它。

You can make a 'custom' REST or HTTP endpoint which invokes the xqy and returns the results in the form you want.您可以制作一个“自定义” REST 或 HTTP 端点,它调用 xqy 并以您想要的形式返回结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM