Hi,
I used an old version of BaseX (7.0 I think) and made HTTP GET requests to application/xquery ressources in the database which evaluated them before returning the result of the evaluation. That way I could used predefined XQuery queries stored in the database. The following sentence is written in the documentation at
http://docs.basex.org/wiki/REST#Operations : "If a resource with content type application/xquery is addressed, it will be evaluated first, and the result will be returned." But it no more the case in 7.2 and instead I get the query verbatim, not the result of the evaluation.
if(type.equals(MimeTypes.APP_XQUERY)) {
// execute raw file as query
final ArrayOutput ao = new ArrayOutput();
session.setOutputStream(ao);
session.execute(new Retrieve(ctx.dbpath()));
query(ao.toString(), ctx);
}
The workaround I used is to put my queries as files in the HTTPPATH directory found in the .basex file.
TIA for any clarification on that matter,
Ludovic Kuty