Hi Marcus,
thanks for your nice and helpful feedback. Some quick comments:
Currently, I'm working on a RESTful Service, where your processor is a great enhancement.
This is an interesting note; one of our members, Lukas (lukas.lewandowski@uni-konstanz.de), is currently combining REST and BaseX as well; you are invited to exchange your experiences.
First: There is problem with XQuery Update, especially with "insert", which is not always reproducable. Example query:
declare variable $newrec as node() external; insert node $newrec as first into basex:db('Recordings')/recordings
The variable $newrec is bound to a "recording" Node with XQJ *.bindNode(new QName("newrec"), node, null);
Sometimes, a ArrayIndexOutOfBoundsException is thrown in "org.basex.query.up.Primitives" at line 51.
Yes, this pretty much looks like a bug - you'll get an answer on this soon.
The second problem I've encountered is with "order by" clause and XQJ API. Order by has no effect, if I use the XQJ Api something like this: XQResultSequence result = null; XQExpression loadExp = null; try { loadExp = this.xqueryManager.createExpression(); result = loadExp.executeQuery(queryString); while(result.next()) { // do something } }
An interesting one.. Could you provide us with a complete example (incl. a sample XML snippet) which demonstrates the behaviour? I just tried a small example query, which seems to be correctly evaluated by the XQJ API..
result = loadExp.executeQuery("for $i in (3,2,1) order by $i return $i"); while(result.next()) { System.out.println(result.getInt()); }
Note that, in the long term, most BaseX developers tend to use our own code APIs, as both the XQJ and XML:DB APIs lack too many requested features. After all, however, we try to keep all APIs bug free, so all kind of feedback is welcome.
Hope this helps, Christian
___________________________
Christian Gruen Universitaet Konstanz Department of Computer & Information Science D-78457 Konstanz, Germany Tel: +49 (0)7531/88-4449, Fax: +49 (0)7531/88-3577 http://www.inf.uni-konstanz.de/~gruen