Hello BaseX-community,
first of all, I really have to say that I really enjoy using BaseX and that I am really impressed by its active development and its ongoing improvement.
I am still a little unsure about the Query 3.0 support via the BaseX XQJ driver from net.xqj, though. According to the Changelog of the website ([1]), XQuery 3.0 via XQJ is now supported:
BaseX 7.3, 18.06.2012 [...] - Charles Foster's latest XQJ Driver supports XQuery 3.0 and the Update and Full Text extensions: http://xqj.net/basex/
The README file of Charles Foster's driver also states that XQuery 3.0 is supported since driver version 1.1.0:
Version 1.1.0: * Supports XQuery 3.0 + XQuery Update Facility + XQuery Full Text extensions. * Various bug fixes.
However, take this minimal example using the simple map operator (query A):
BaseXXQDataSource dataSource = new BaseXXQDataSource(); dataSource.setServerName("localhost"); dataSource.setPort(1984);
XQConnection con = dataSource.getConnection("dict_wsa", "lidell");
con.createExpression().executeQuery( "(1 to 3) ! (. * 2))"); //query A
con.createExpression().executeQuery( "let $m := map { 'one' := 1, 'two' := 2 }" + "return ($m('one')"); //query B
Executing it yield a syntax exception:
Exception in thread "main" javax.xml.xquery.XQException: XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. Root Cause: net.xqj.basex.bin.bn: Lexical error at line 1, column 11. Encountered: " " (32), after : "!" at XQ3Test.main(XQ3Test.java:21) at XQ3Test.main(XQ3Test.java:21)
For query B I also receive a syntax exception:
Exception in thread "main" javax.xml.xquery.XQException: XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. Root Cause: net.xqj.basex.bin.bj: Encountered " "{" "{ "" at line 1, column 15. Was expecting one of: "=" ... "order" ... "," ...
Is there another option I have to set to circumvent the 'static validation' or did I overlook anything else?
Regards and thanks in advance for any information or advice,
Markus Ackermann
PS: Information on the execution environment: JVM: 1.7.0_13 (Oracle Corporation 23.7-b01) OS: Linux 3.0.0-30-generic amd64 (Ubuntu 11.10) BaseX 7.6