W3C home > Mailing lists > Public > public-qt-comments@w3.org > June 2007

[Bug 4611] [UPD] Better error specification for updating function with declared return type

From: <bugzilla@wiggum.w3.org>
Date: Fri, 08 Jun 2007 17:57:15 +0000
To: public-qt-comments@w3.org
Message-Id: <E1Hwii3-0003b3-H4@wiggum.w3.org>


           Summary: [UPD] Better error specification for updating function
                    with declared return type
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Update Facility
        AssignedTo: andrew.eisenberg@us.ibm.com
        ReportedBy: john.snelson@oracle.com
         QAContact: public-qt-comments@w3.org

In section 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")
Received on Friday, 8 June 2007 17:57:17 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:33 UTC