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 16104 - [XQ30] Distinct annotation names; and error XQST0116
Summary: [XQ30] Distinct annotation names; and error XQST0116
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: P2 minor
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 10:52 UTC by Michael Kay
Modified: 2013-06-19 09:15 UTC (History)
3 users (show)

See Also:


Attachments

Description Michael Kay 2012-02-24 10:52:07 UTC
(1) I think there should be a rule that the annotations on a variable or function should have distinct names. Without such a rule, annotion assertions don't seem to make much sense. We don't seem to have such a rule at the moment.

(2) Quote:

 It is a static error [err:XQST0116] if a variable declaration's's annotations contain more than one annotation named %private or %public.

Three problems here.

(a) the doubled "'s"

(b) the sentence is ambiguous, it doesn't really state clearly that you can't have one annotation named %private and another named %public. 

(c) there is no corresponding error for function annotations.

If we fix (1) above then we can write this as

It is a static error [err:XQST0116] if the set of annotations on a function declaration or variable declaration inlcudes both a %public and a %private annotation.
Comment 1 Josh Spiegel 2012-03-20 14:41:21 UTC
With respect to (c), I think there is a corresponding error in section 4.18:

"It is a static error [err:XQST0106] if a function's annotations contain more than one annotation named ""http://www.w3.org/2005/xpath-functions"":private or ""http://www.w3.org/2005/xpath-functions"":public."
Comment 2 John Snelson 2012-03-30 08:59:42 UTC
With respect to (1), I disagree. It's perfectly acceptable to have more than one annotation with the same name - what that means is defined by the implementation that understands the annotation. For instance, it seems perfectly reasonable for a given function to be made available at two different URLs using the (hypothetical) %rest:url annotation.

With respect to (2c), there is no annotation assertion error because %public and %private are not valid as a annotation assertions.
Comment 3 Jonathan Robie 2012-06-12 16:23:48 UTC
As Mary pointed out today, it may make sense to have two annotations with the same name and different parameters.
Comment 4 Jonathan Robie 2012-06-12 16:27:32 UTC
(In reply to comment #0)
> (1) I think there should be a rule that the annotations on a variable or
> function should have distinct names. Without such a rule, annotion assertions
> don't seem to make much sense. We don't seem to have such a rule at the moment.

The WG disagrees - it makes sense to allow multiple annotation assertions with the same name and different parameters.

> (c) there is no corresponding error for function annotations.
> 
> If we fix (1) above then we can write this as
> 
> It is a static error [err:XQST0116] if the set of annotations on a function
> declaration or variable declaration inlcudes both a %public and a %private
> annotation.

The WG disagrees. There are no annotation assertions for %public and %private.
Comment 5 Jonathan Robie 2012-06-12 16:28:15 UTC
I agree with this - it's editorial:

> Three problems here.
> 
> (a) the doubled "'s"
> 
> (b) the sentence is ambiguous, it doesn't really state clearly that you can't
> have one annotation named %private and another named %public.