This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5804 - [XQuery] Version numbers in XQuery version declarations
Summary: [XQuery] Version numbers in XQuery version declarations
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Recommendation
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-25 16:40 UTC by John Snelson
Modified: 2017-04-28 20:26 UTC (History)
5 users (show)

See Also:


Attachments

Description John Snelson 2008-06-25 16:40:06 UTC
In the XQuery specification section 4.1 it is stated:

"An XQuery implementation must raise a static error [err:XQST0031] when processing a module labeled with a version that the implementation does not support."

This doesn't provide very good forwards compatibility, and probably should be changed in preparation for XQuery 1.1. I propose that execution of a query with a version number other than "1.0" (in particular "1.1") should still be attempted.

Two other non-obvious cases should also probably be considered:

1) What does an XQuery 1.1 processor do with a query declared as version "1.0" which uses XQuery 1.1 features?

2) What does an XQuery 1.1 processor do with a query whose version is not declared and which uses XQuery 1.1 features?

John
Comment 1 John Snelson 2008-08-04 14:19:16 UTC
The results of working group discussion on this subject lead to believe that:

1) An XQuery 1.0 processor should reject a query labeled as version "1.1".
2) An XQuery processor (any version) should attempt to process an XQuery whose version is not given.
3) An XQuery 1.1 processor should either reject a query labeled as version "1.0", or fall back to using an XQuery 1.0 processor to process the query.

In addition:

4) We should define the terms "XQuery 1.0 processor" and "XQuery 1.1 processor".
5) We should make it easier to not declare the version of the query, by allowing an encoding declaration without a version declaration.

To this end I therefore propose the following changes to the XQuery 1.1 specification:

i) At the end of section 1 (or in section 4.1?), add:

<new>
[Definition: An XQuery 1.1 processor is capable of processing a query according to the XQuery 1.1 specification.]
[Definition: An XQuery 1.0 processor is capable of processing a query according to the XQuery 1.0 specification.]
</new>

ii) In section 4.1, change the grammar for VersionDecl to:

VersionDecl ::= "xquery" (("encoding" StringLiteral) | ("version" StringLiteral ("encoding" StringLiteral)?)) Separator

iii) In section 4.1, change the first paragraph to:

<new>
[Definition: Any module may contain a version declaration. If present, the version declaration occurs at the beginning of the module and can identify the applicable XQuery syntax and semantics for the module, as well as it's encoding.] The version number "1.0" indicates a requirement that the module must be processed by an XQuery 1.0 processor - similarly the version number "1.1" indicates a requirement that the module must be processed by an XQuery 1.1 processor. If the version declaration is not present or the version is not included in the declaration, an XQuery 1.1 processor assumes a version of "1.1". If an XQuery 1.1 processor processes a module labeled with a version other than "1.1, it must either raise a static error [err:XQST0031], or attempt to process the module with an XQuery 1.0 processor. It is the intent of the XQuery working group to give later versions of this specification numbers other than "1.0" and "1.1", but this intent does not indicate a commitment to produce any future versions of XQuery, nor if any are produced, to use any particular numbering scheme.
</new>
Comment 2 Michael Dyck 2008-08-04 17:18:17 UTC
(In reply to comment #1)
> 
> If an XQuery 1.1 processor processes a module labeled with a version
> other than "1.1, it must either raise a static error [err:XQST0031],
> or attempt to process the module with an XQuery 1.0 processor.

Do we allow different modules in the same query to be processed by differently-numbered XQuery processors? If so, what does it mean?


(Also, in "as well as it's encoding", that should be "its", no apostrophe.)
Comment 3 John Snelson 2008-08-05 10:35:04 UTC
(In reply to comment #2)
> Do we allow different modules in the same query to be processed by
> differently-numbered XQuery processors? If so, what does it mean?

That was the intention - there appears to be nothing in the section 4.11 (Module Import) to either prohibit or allow it. Doesn't it have the same meaning as any other module import? I'm not sure I see the need to define anything more for this aspect of query versions, unless we just want to add a clarifying note.
Comment 4 Jonathan Robie 2008-09-23 16:38:27 UTC
We are not making this change in XQuery 1.0, but we are considering it for the next draft of XQuery 1.1. 
Comment 5 Jonathan Robie 2008-10-20 13:26:53 UTC
I think it's better to say that a processor actually does process a query according to the corresponding specification, not just that it is capable of doing so. So instead of this:

<new>
[Definition: An XQuery 1.1 processor is capable of processing a query according
to the XQuery 1.1 specification.]
[Definition: An XQuery 1.0 processor is capable of processing a query according
to the XQuery 1.0 specification.]
</new>


I prefer this:

<new>
[Definition: An XQuery 1.1 processor processes a query according
to the XQuery 1.1 specification.]
[Definition: An XQuery 1.0 processor processes a query according
to the XQuery 1.0 specification.]
</new>
Comment 6 John Snelson 2008-10-20 13:33:49 UTC
I think it makes very little difference. I suppose with the former, you can say "XQilla is an XQuery 1.0 processor", but with the latter you can only say "XQilla contains an XQuery 1.0 processor". In that sense, I slightly prefer the former original text.
Comment 7 Michael Kay 2008-10-20 14:14:42 UTC
In XSLT we considered the situation of a vendor who chose to do what Altova have in fact done: to use the version number in the stylesheet to decide whether to run according to the 1.0 or 2.0 spec. To describe this situation we did indeed adopt the terminology Jonathan is proposing: A 1.0 processor is one that processes according to the 1.0 spec, a 2.0 processor is one that does so according to the 2.0 spec, and a software product that uses the version attribute to decide which spec to follow contains both a 1.0 and a 2.0 processor. I think this ends up being clearer, although it might not be the language that users would choose instinctively.

This formulation means that in this situation the decision which processor to invoke is made by a piece of software that is not actually governed by either specification, which means we don't get into the kind of loop where the 2.0 spec needs to contain a normative reference to the 1.0 spec.

Michael Kay
Comment 8 Jonathan Robie 2008-10-20 14:20:14 UTC
This part of the proposal strikes me as odd:

If an XQuery 1.1 processor processes a module labeled with a version
other than "1.1", it must either raise a static error [err:XQST0031], or attempt
to process the module with an XQuery 1.0 processor.

Suppose an XQuery 1.1 processor processes a module labeled with the version number "3.14159". According to the above text, it is valid to process it using an XQuery 1.0 processor, but not with an XQuery 1.1 processor. Is that really intended?

Comment 9 Jonathan Robie 2008-10-20 14:51:27 UTC
I propose the following text for XQuery 1.1:

Introduction:

[Definition: An XQuery 1.1 Processor processes a query according to the XQuery 1.1 specification.]

[Definition: An XQuery 1.0 Processor processes a query according to the XQuery 1.0 specification.]

Version Declarations:


[2]    	VersionDecl 	   ::=    	"xquery" (("encoding" StringLiteral) | ("version" StringLiteral ("encoding" StringLiteral)?)) Separator

[Definition: A version declaration can identify the applicable XQuery syntax and semantics for a module, as well as its encoding.] The version number "1.0" indicates a requirement that the module must be processed by an XQuery 1.0 processor; the version number "1.1" indicates a requirement that the module must be processed by an XQuery 1.1 processor. If the version declaration is not present or the version is not included in the declaration, an XQuery 1.1 processor assumes a version of "1.1". If an XQuery 1.1 processor processes a module labeled with a version of "1.0", it must either raise a static error [err:XQST0031], or attempt to process the module with an XQuery 1.0 processor. It is the intent of the XQuery working group to give later versions of this specification numbers other than "1.0" and "1.1", but this intent does not indicate a commitment to produce any future versions of XQuery, nor if any are produced, to use any particular numbering scheme.
Comment 10 John Snelson 2008-10-20 15:23:55 UTC
(In reply to comment #8)
> This part of the proposal strikes me as odd:
> 
> If an XQuery 1.1 processor processes a module labeled with a version
> other than "1.1", it must either raise a static error [err:XQST0031], or
> attempt
> to process the module with an XQuery 1.0 processor.
> 
> Suppose an XQuery 1.1 processor processes a module labeled with the version
> number "3.14159". According to the above text, it is valid to process it using
> an XQuery 1.0 processor, but not with an XQuery 1.1 processor. Is that really
> intended?

Of course - it's a clear definition, that falls back on an XQuery 1.0 processor - where the XQuery 1.0 processor is then defined to reject the version of "3.14159".
Comment 11 Jonathan Robie 2009-07-14 15:52:11 UTC
Adopting comment #9, modified as follows: If any version number other than 1.1 or 1.0 is encountered, a static error is raised.