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 4611 - [UPD] Better error specification for updating function with declared return type
Summary: [UPD] Better error specification for updating function with declared return type
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Update Facility (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Andrew Eisenberg
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-08 17:57 UTC by John Snelson
Modified: 2007-08-07 09:40 UTC (History)
0 users

See Also:


Attachments

Description John Snelson 2007-06-08 17:57:15 UTC
In section 2.5.6.2.a the XQuery Update specification states:

as SequenceType must not be specified because, in the current design, the XDM instance returned by an updating expression is always the empty sequence.

The EBNF grammar production for a function declaration is this:

[26] FunctionDecl ::= "declare" "updating"? "function" QName "(" ParamList? ")" ("as" SequenceType)? (EnclosedExpr | "external")

Since the grammar production does not disallow the specifying of a return type, I believe we need to take one of two actions:

1) Specify an error code for the static error to be raised in the event of a return type being present.

2) Tighten the EBNF grammar production to disallow a return type when "updating" is used, thus including such a use under error [err:XPST0003]. This could be done by replacing grammar production 26 with the following:

[26] FunctionDecl ::= NonUpdatingFunctionDecl | UpdatingFunctionDecl

[26a] NonUpdatingFunctionDecl ::= "declare" "function" QName "(" ParamList? ")" ("as" SequenceType)? (EnclosedExpr | "external")

[26b] UpdatingFunctionDecl ::= "declare" "updating" "function" QName "(" ParamList? ")" (EnclosedExpr | "external")
Comment 1 Don Chamberlin 2007-07-26 23:37:04 UTC
John,
On June 28, 2007, the Query Working Group agreed to resolve this bug report by adding a new static error code, XUST0028, for the case when a function declaration specifies both "updating" and a return type. This change will appear in the next version of the Update specification. If you are satisfied with this resolution, please change the status of this bug report to "Closed".
Regards,
Don Chamberlin (for the Query Working Group)