Hi Christian,
wow, that's quick :) However, after installing that update, I am now getting an error when doing a normal GET query that used to work fine:
GET http://localhost:8984/rest?run=list.xq Stopped at line 1, column 7: [XPDY0002] No context item set for 'list.xq'.
Is that a regression?
Kind regards, Ralf
On Thursday 22 September 2011 16:49:51 Christian Grün wrote:
Ralf,
you can be lucky, we've just realized another one of your feature requests. Your feedback is quite helpful indeed, as you're currently the first active external tester of our integrated REST implementation ;)
The initial context node for a query can now be specified by adding an additional <context/> item:
<query xmlns="http://www.basex.org/rest"> <text>for $i in .//text() return string-length($i)</text> <context> <xml> <text>Hello</text> <text>World</text> </xml> </context> </query>
We're still pondering how to deal with the content type issue; have you got any feedback from Orbeon? Christian ___________________________
On Thu, Sep 22, 2011 at 12:38 AM, Christian Grün
christian.gruen@gmail.com wrote:
<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