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 15687 - [XQ30] Annotations and XQST0045
Summary: [XQ30] Annotations and XQST0045
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 (show other bugs)
Version: Member-only Editors Drafts
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
: 19089 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-01-24 10:19 UTC by Tim Mills
Modified: 2012-09-27 08:40 UTC (History)
0 users

See Also:


Attachments

Description Tim Mills 2012-01-24 10:19:13 UTC
XQuery 3.0 states in 4.15 Annotations:

"Implementations MAY define further annotations, whose behaviour is implementation-defined. For instance, if the eg prefix is bound to a namespace associated with a particular implementation, it could define an annotation like eg:sequential. Implementations MUST NOT define annotations in the following reserved namespaces; it is an error for users to create annotations in the following reserved namespaces [err:XQST0045]:

    http://www.w3.org/XML/1998/namespace
    http://www.w3.org/2001/XMLSchema
    http://www.w3.org/2001/XMLSchema-instance
    http://www.w3.org/2005/xpath-functions
    http://www.w3.org/2005/xpath-functions/math
    http://www.w3.org/2011/xquery-options"

This isn't entirely the same as the later appendix definition of the error code, which seems to be at odds with the definition of %fn:private or %fn:public which are in http://www.w3.org/2005/xpath-functions.

err:XQST0045

    It is a static error if the name of an annotation or the function name in a function declaration is in one of the following namespaces: http://www.w3.org/XML/1998/namespace, http://www.w3.org/2001/XMLSchema, http://www.w3.org/2001/XMLSchema-instance, http://www.w3.org/2005/xpath-functions, http://www.w3.org/2005/xpath-functions/math, http://www.w3.org/2011/xquery-options.

Whether these two agree hinges on whether "creating an annotation" is the same as using an annotation.  The definition is also ambiguous: does it mean 

the name of an annotation in a function declaratio or
the function name in a function declaratio

or

the name of an annotation in a function declaratio or function test or
the function name in a function declaratio

?

So I'm not clear whether the following (from QT3 test annotation-2) should expect XQST0045 (since it uses, but doesn't define an annotation is a reserved namespace).

 declare %fn:x function local:foo() {
            "bar"
         };

Similarly, I'm not clear whether the following (from QT£ test annotation-assertion-16) should expect XQST0045.

  () instance of %fn:x function(*)
Comment 1 Jonathan Robie 2012-02-14 14:37:12 UTC
(In reply to comment #0)
> XQuery 3.0 states in 4.15 Annotations:
> 
> !!! SNIP !!! it is an error for users to create annotations in the
> following reserved namespaces [err:XQST0045]:

We will change this to:

"it is an error for a user to declare a function or a variable with an annotation in the following reserved namespaces, except for annotations defined in the XQuery family of specifications."

>  declare %fn:x function local:foo() {
>             "bar"
>          };

This is an error.

> Similarly, I'm not clear whether the following (from QT£ test
> annotation-assertion-16) should expect XQST0045.
> 
>   () instance of %fn:x function(*)

We will say:


"it is an error to use an annotation in the following reserved namespaces, except for annotations defined in the XQuery family of specifications."
Comment 2 Jonathan Robie 2012-02-14 14:42:49 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > XQuery 3.0 states in 4.15 Annotations:
> > 
> > !!! SNIP !!! it is an error for users to create annotations in the
> > following reserved namespaces [err:XQST0045]:
> 
> We will change this to:
> 
> "it is an error for a user to declare a function or a variable with an
> annotation in the following reserved namespaces, except for annotations defined
> in the XQuery family of specifications."
 
Ooops - that's oddly worded. 

"if a user declares a function or a variable with an annotation in the following reserved namespaces, the annotation must be defined in the XQuery family of specifications [err:TBD]. For instance, a function may be declared %fn:private, but not %fn:carrot.

> > Similarly, I'm not clear whether the following (from QT£ test
> > annotation-assertion-16) should expect XQST0045.
> > 
> >   () instance of %fn:x function(*)
> 
> We will say:
> 
> "it is an error to use an annotation in the following reserved namespaces,
> except for annotations defined in the XQuery family of specifications."

Make that:

"it is an error to use an annotation assertion in the following reserved namespaces,
except for annotation assertions defined in the XQuery family of specifications."
Comment 3 Adam Retter 2012-02-14 14:51:48 UTC
We should consider separate error codes for annotations on functions in the fn reserved namespace vs. the annotation assertions of annotations in the fn reserved namespace.
Comment 4 Tim Mills 2012-09-27 08:40:55 UTC
*** Bug 19089 has been marked as a duplicate of this bug. ***