Simple Map Operator in oXygen XML (XQJ)
Monday, 4 September 2017 · 6 messages · last reply 18 Sep 2017
OS
Omar Siam4 Sep 2017 14:31 #
Hi!
I just tried to use ther Simple Map Operator while writing an XQuery in oXygen XML and executing the query using a client/server BaseX 8.6.6 data source. I configured it as described here:
http://docs.basex.org/wiki/Integrating_oXygen
When I use the Simple Map Operator (!) I only get "Invalid XQuery syntax, syntax does not pass static validation.". For example using "(1 to 10) ! element node { . }"
If I run that XQuery in DBA for example it works.
Any ideas?
Best regards
Omar Siam
KK
Kristian Kankainen4 Sep 2017 14:41 #
Maybe you need to declare a high enough version of XQuery to use in the query prolog?
Best regards
Kristian K
04.09.2017 15:31 Omar Siam kirjutas:
Quoted text · Omar Siam · 19 lines
> Hi! > > I just tried to use ther Simple Map Operator while writing an XQuery > in oXygen XML and executing the query using a client/server BaseX > 8.6.6 data source. I configured it as described here: > http://docs.basex.org/wiki/Integrating_oXygen > > When I use the Simple Map Operator (!) I only get "Invalid XQuery > syntax, syntax does not pass static validation.". For example using > "(1 to 10) ! element node { . }" > > If I run that XQuery in DBA for example it works. > > Any ideas? > > Best regards > > Omar Siam >
MS
Hi Omar,
Looks like that error message is generated by oXygen; you might want to crosspost to their list.
Best
Michael
Quoted text · Omar Siam · 16 lines
> Am 04.09.2017 um 14:31 schrieb Omar Siam <Omar.Siam at oeaw.ac.at>: > > Hi! > > I just tried to use ther Simple Map Operator while writing an XQuery in oXygen XML and executing the query using a client/server BaseX 8.6.6 data source. I configured it as described here: http://docs.basex.org/wiki/Integrating_oXygen > > When I use the Simple Map Operator (!) I only get "Invalid XQuery syntax, syntax does not pass static validation.". For example using "(1 to 10) ! element node { . }" > > If I run that XQuery in DBA for example it works. > > Any ideas? > > Best regards > > Omar Siam >
OS
Omar Siam4 Sep 2017 16:47 #
Good idea but I was pretty sure that this comes from within BaseX not oXygen. You can configure the parser and the executor of your XQuery in oXygen und I used BaseX for both.
So I found in basex-examples a XQJ tutorial. And just by changing Part1.java a little and filling in the example query from the Wiki I also get
XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. Root Cause:
net.xqj.basex.bin.bB: Lexical error at line 1, column 12. Encountered: " " (32), after : "!"
at
org.basex.examples.xqj.tutorial.simplemaptest.main(simplemaptest.java:34) at
org.basex.examples.xqj.tutorial.simplemaptest.main(simplemaptest.java:34)
So most probably BaseX'es XQJ parser does not understand the simple map operator.
XQSequence xqjs = xqje.executeQuery("xquery version \"3.1\"; (1 to 10) ! element node { . }");
Quoted text · Michael Seiferle · 24 lines
Am 04.09.2017 um 15:37 schrieb Michael Seiferle: > Hi Omar, > > Looks like that error message is generated by oXygen; you might want to crosspost to their list. > > Best > Michael > >> Am 04.09.2017 um 14:31 schrieb Omar Siam<Omar.Siam at oeaw.ac.at>: >> >> Hi! >> >> I just tried to use ther Simple Map Operator while writing an XQuery in oXygen XML and executing the query using a client/server BaseX 8.6.6 data source. I configured it as described here:http://docs.basex.org/wiki/Integrating_oXygen >> >> When I use the Simple Map Operator (!) I only get "Invalid XQuery syntax, syntax does not pass static validation.". For example using "(1 to 10) ! element node { . }" >> >> If I run that XQuery in DBA for example it works. >> >> Any ideas? >> >> Best regards >> >> Omar Siam >>
OS
Omar Siam4 Sep 2017 17:25 #
Ok. Interesting. Please someone note this in the Wiki so there are no surprises. For the ! syntax I can just stick with for in return but missing map {} is a reason to switch to dba.
Best regards
Omar
Quoted text · Omar Siam · 91 lines
Am 04.09.2017 um 17:14 schrieb Charles Foster: > Hi Michael, > > BaseX XQJ supports XQuery 3.0 syntax I believe, but not XQuery 3.1 > specific syntax. > > It would be possible to update the XQJ driver to support XQuery 3.1 > syntax, but it would mean upgrading the internal XQuery parser and > re-writer. > > Omar, as a work around you could potentially use equivalent functions > in the standard F&O library (fn). > > Kind Regards, > > Charles > > >> On 4 Sep 2017, at 22:02, Michael Seiferle <ms at basex.org >> <mailto:ms at basex.org>> wrote: >> >> Hi Omar, >> /cc Hi @Charles, >> >> you are right, this has nothing to with oXygen in particular! >> Yet: I am not even sure if XQJ is meant to support anything but >> XQuery 1.0. >> Charles might correct me if I am wrong, but I don’t think there’s an >> easy way to add 3.1 features to the current XQJ implementation. >> >> Best from Konstanz >> >> Michael >> >> >> >> >> >>> Am 04.09.2017 um 16:42 schrieb Omar Siam <Omar.Siam at oeaw.ac.at >>> <mailto:Omar.Siam at oeaw.ac.at>>: >>> >>> Good idea but I was pretty sure that this comes from within BaseX >>> not oXygen. You can configure the parser and the executor of your >>> XQuery in oXygen und I used BaseX for both. >>> >>> So I found in basex-examples a XQJ tutorial. And just by changing >>> Part1.java a little and filling in the example query from the Wiki I >>> also get >>> >>> XQJQS001 - Invalid XQuery syntax, syntax does not pass static >>> validation. >>> Root Cause: >>> net.xqj.basex.bin.bB: Lexical error at line 1, column 12. >>> Encountered: " " (32), after : "!" >>> at >>> org.basex.examples.xqj.tutorial.simplemaptest.main(simplemaptest.java:34) >>> at >>> org.basex.examples.xqj.tutorial.simplemaptest.main(simplemaptest.java:34) >>> >>> So most probably BaseX'es XQJ parser does not understand the simple >>> map operator. >>> >>> XQSequence xqjs = xqje.executeQuery("xquery version \"3.1\"; (1 to 10) ! element node { . }"); >>> >>> Am 04.09.2017 um 15:37 schrieb Michael Seiferle: >>>> Hi Omar, >>>> >>>> Looks like that error message is generated by oXygen; you might want to crosspost to their list. >>>> >>>> Best >>>> Michael >>>> >>>>> Am 04.09.2017 um 14:31 schrieb Omar Siam<Omar.Siam at oeaw.ac.at>: >>>>> >>>>> Hi! >>>>> >>>>> I just tried to use ther Simple Map Operator while writing an XQuery in oXygen XML and executing the query using a client/server BaseX 8.6.6 data source. I configured it as described here:http://docs.basex.org/wiki/Integrating_oXygen >>>>> >>>>> When I use the Simple Map Operator (!) I only get "Invalid XQuery syntax, syntax does not pass static validation.". For example using "(1 to 10) ! element node { . }" >>>>> >>>>> If I run that XQuery in DBA for example it works. >>>>> >>>>> Any ideas? >>>>> >>>>> Best regards >>>>> >>>>> Omar Siam >>>>> >>> >> >
CG
Christian Grün18 Sep 2017 15:40 #
Hi Omar,
Quoted text · Omar Siam · 2 lines
> Ok. Interesting. Please someone note this in the Wiki so there are no > surprises.
I have added a little hint in our Wiki [1].
Cheers,
Christian
[1] http://docs.basex.org/wiki/Developing
Quoted text · Omar Siam · 104 lines
For the ! syntax I can just stick with for in return but missing > map {} is a reason to switch to dba. > > Best regards > > Omar > > > Am 04.09.2017 um 17:14 schrieb Charles Foster: > > Hi Michael, > > BaseX XQJ supports XQuery 3.0 syntax I believe, but not XQuery 3.1 specific > syntax. > > It would be possible to update the XQJ driver to support XQuery 3.1 syntax, > but it would mean upgrading the internal XQuery parser and re-writer. > > Omar, as a work around you could potentially use equivalent functions in the > standard F&O library (fn). > > Kind Regards, > > Charles > > > On 4 Sep 2017, at 22:02, Michael Seiferle <ms at basex.org> wrote: > > Hi Omar, > /cc Hi @Charles, > > you are right, this has nothing to with oXygen in particular! > Yet: I am not even sure if XQJ is meant to support anything but XQuery 1.0. > Charles might correct me if I am wrong, but I don’t think there’s an easy > way to add 3.1 features to the current XQJ implementation. > > Best from Konstanz > > Michael > > > > > > Am 04.09.2017 um 16:42 schrieb Omar Siam <Omar.Siam at oeaw.ac.at>: > > Good idea but I was pretty sure that this comes from within BaseX not > oXygen. You can configure the parser and the executor of your XQuery in > oXygen und I used BaseX for both. > > So I found in basex-examples a XQJ tutorial. And just by changing Part1.java > a little and filling in the example query from the Wiki I also get > > XQJQS001 - Invalid XQuery syntax, syntax does not pass static validation. > Root Cause: > net.xqj.basex.bin.bB: Lexical error at line 1, column 12. Encountered: " > " (32), after : "!" > at > org.basex.examples.xqj.tutorial.simplemaptest.main(simplemaptest.java:34) > at > org.basex.examples.xqj.tutorial.simplemaptest.main(simplemaptest.java:34) > > So most probably BaseX'es XQJ parser does not understand the simple map > operator. > > XQSequence xqjs = xqje.executeQuery("xquery version \"3.1\"; (1 to 10) ! > element node { . }"); > > > Am 04.09.2017 um 15:37 schrieb Michael Seiferle: > > Hi Omar, > > Looks like that error message is generated by oXygen; you might want to > crosspost to their list. > > Best > Michael > > Am 04.09.2017 um 14:31 schrieb Omar Siam <Omar.Siam at oeaw.ac.at>: > > Hi! > > I just tried to use ther Simple Map Operator while writing an XQuery in > oXygen XML and executing the query using a client/server BaseX 8.6.6 data > source. I configured it as described here: > http://docs.basex.org/wiki/Integrating_oXygen > > When I use the Simple Map Operator (!) I only get "Invalid XQuery syntax, > syntax does not pass static validation.". For example using "(1 to 10) ! > element node { . }" > > If I run that XQuery in DBA for example it works. > > Any ideas? > > Best regards > > Omar Siam > > > > >
Written for BaseX 8.6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery