Mark Logic Command: invoke
invoke calls a server side xquery on a Mark Logic serverSynopsis
invoke [-c uri|-connect uri] [-t] [-v] script [varname value [varname value ...]]Description
Invokes a script (xquery file) residing on a Mark Logic server.Optionally passing in variable (parameters) to the script.
-c,connect uri | Use the connection string instead of $MLCONNECT |
-t | Output result as text (instead of xml). |
-v | Assign variables (parameters) from the remaining arguments |
script | path to script on the marklogic server |
Example
Assuming the prefix "ml" is imported as the marklogic module, invoke the "test.xq" script on the server passing in a parameter "id" with the value "123"ml:invoke -v test.xq id 123
The "-t" option is used to serialize directly as text. This converts non element output such as attributes directly to text.
Otherwise xml output is used. Using -t and redirecting to a variable results in a string type variable, otherwise an XML type variable is produced.
See Serialization.
MarkLogic Extension Module