1
votes

I am working on a FLWOR XQuery expression and I want to use the group by in my code. but it gives me this error everytime I use group by "XPST0003: To use XQuery 3.0 syntax, you must request XQuery version 3.0 both in the prolog and in the command line or API".

Please help me. I am currently using XQuery version 1.0 or SAXON-EE XQuery 9.5.1.2. I running Oxygen for this purpose.

1
please update your Q following these guidelines stackoverflow.com/help/mcve . Good luck.shellter
If you have problems using XQuery 3 in oXygen then please edit your question tell us which version of oXygen you use. Then also add the tag for oXygen.Martin Honnen

1 Answers

2
votes

group by is not available in XQuery 1.0. In Saxon 9.5, to use XQuery 3.0 you must

  1. use a licensed edition of Saxon-EE (which is automatic if you use oXygen)
  2. specify xquery version 3.0 in the query prolog
  3. configure Saxon to support XQuery version 3.0, e.g. by specifying -qversion:3.0 on the command line, or by ticking the box "Enable XQuery 3.0 support" in oXygen.

These rules were relaxed in Saxon 9.6. The reason for these rules in 9.5 was that at the time 9.5 came out in 2013, the specification of XQuery 3.0 was not yet stable, and we felt it was for "bleeding edge" users only. Given that 9.5 was released before XQuery 3.0 was finalized, you should use 3.0 features with care since the spec might have changed. Ideally, move to Saxon 9.6.