Bug #6228
closed
The -qversion flag is undocumented
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Description
This comes from an internal Slack discussion. In order to use (at least some) XQuery 4.0 features, you must pass the -qversion:4.0
flag to the processor in addition to declaring the XQuery version in the query.
I wonder if we could make --allowSyntaxExtensions:on
work for XQuery as well, since the -qversion
option isn't already documented.
I think the reason -qversion is undocumented is that it was originally used to discriminate between 1.0/3.0/3.1, and then dropped out of use when we only supported 3.1. So it was always there, but was dropped from the documentation and not reinstated when it became meaningful again. (Search for -qversion, and there are a couple of very old references in the change history).
It looks like the XQuery declaration "xquery version '4.0'" is enough to enable 4.0 in the query parser, but not in the tokenizer, and =!>
is being rejected by the tokenizer.
Most of the places where the tokenizer needs to know the language level are cases where the parser ends up not seeing the difference, for example underscores in numeric literals. I will change the logic for =!>
so it is rejected at the parser level, which gives better diagnostics.
But I'll also fix it so that 4.0 is allowed by the tokenizer if it is allowed by the parser.
- Private changed from Yes to No
Specifying xquery version '4.0';
in the XQuery version declaration is now enabling 4.0 features in the parser and the tokenizer, but not in the function library. This is because the function library for a query module is initialized before parsing starts. It's complicated by the fact that we need to consider not only the top-level module, but also library modules; in principle a library module can use a different version number from the main module.
- Category set to Configuration
- Status changed from New to Resolved
- Assignee set to Michael Kay
- Applies to branch 12, trunk added
- Fix Committed on Branch 12, trunk added
- Platforms .NET, Java added
When running from the command line, XQuery 4.0 is now enabled by any of the following:
- A version declaration
xquery version '4.0';
- -qversion:4.0
- --allowSyntaxExtensions:on
- Status changed from Resolved to Closed
- % Done changed from 0 to 100
- Fixed in Maintenance Release 12.4 added
Bug fix applied in the Saxon 12.4 maintenance release
Please register to edit this issue
Also available in: Atom
PDF