Wiki source for ExistInvoke

Show raw source

======eXist Command: invoke======
invokes a stored query on an eXist server

invoke [exist options] [options] query-uri

Invokes a stored query residing on an eXist server. In order for a resource to be used with invoke it must be stored with the Content-Type of "application/xquery".

The invoke command accepts all [[ExistCommonOptions eXist Common Options]]

||-d,-data file||Supplies the contents of "file" as the input data to the stored query||
||-raw||Outputs the results without any parsing. Supplying -d assumes -raw||

If -d or -data is specified then the file (or standard input if "-") is supplied to the query. Otherwise no data is supplied to the query.

Assuming the prefix "e" is imported as the exist, invokes the stored procedure "run.xquery"

e:invoke run.xquery

For example storing the query "1 to 5,'hi',<elem/>" then invoking it.

echo "1 to 5,'hi',<elem/>" | e:put -uri /db/test/run.xquery -contentType application/xquery
e:invoke /db/test/run.xquery



invoke is implemented using the REST protocol using the GET and POST methods.
When no -data argument is supplied then GET is used and the result is wrapped by eXist into a structure which is parsed as XDM values (unless -raw is specified).
When a -data argument is supplied then POST is used and the resulting data is returned in the raw as text.

See [[]]

[[ModuleExist eXist Extension Module]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki