This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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")
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)