<run xmlns="http://www.basex.org/rest"> <file>query.xq</file> <!-- or maybe use "text" here as well, for consistency? sounds weird though --> <input><document/></input> <variable name="x" value="something"/> </run>
..this shouldn't be any problem, as the "query" and "run" operations are very similar (see http://docs.basex.org/wiki/REST_POST_Schema).
I assume that, if the XML is set to be the context of the entire XQuery script, I can access it within the script like this?
let $param := . let $something := $param//text() ...
Exactly.
Regards, Christian