Aviator
Aviator

Reputation: 722

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.

Upvotes: 0

Views: 71

Answers (1)

DALDEI
DALDEI

Reputation: 3732

You can use the REST API and some HTTP aware command line client like curl or 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.

You can use a program designed to do this such as xmlsh and the marklogic extension 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.

You can make a 'custom' REST or HTTP endpoint which invokes the xqy and returns the results in the form you want.

Upvotes: 2

Related Questions