3

所以我有一个文件uris.xqy,它获取我想在corb中操作的文档 URI 。

然后我有引入$URI 的 docs.xqy declare variable $URI as xs:string external;

然后我对该文件进行一些处理。

现在我想从命令行向 corb 传递一个参数,这样 ./ml ${Environment} corb --uris=/uris.xqy --modules=/docs.xqy --hello=world

当我执行上面的命令时,我可以访问hello ,它是docs.xqy中的内容世界

4

2 回答 2

4

I think what you are looking for is a Custom Property

PROCESS-MODULE.hello=world

The CORB2 wiki explains this at

https://github.com/marklogic/corb2/wiki/Other-Properties#custom-properties

To use a custom property, it must be prepended with the Task name and declared as an external variable in the XQuery.

To pass a collection name to the PROCESS task use:

PROCESS-MODULE.collectionName=nameOfCollectionToUse

于 2015-07-31T18:34:42.553 回答
1

--使用 Roxy v1.7.4+,您现在可以使用或-D开关指定任何 CoRB 选项,以包括自定义模块输入。

如果您升级到 Roxy 1.7.4.1(或更高版本),您可以通过执行以下命令将值发送到名为“hello”的docs.xqy模块外部变量:

./ml ${Environment} corb --uris=/uris.xqy --modules=/docs.xqy --PROCESS-MODULE.hello=world
于 2016-12-12T02:54:33.593 回答