[Bug 8713] New: [XQuery 1.0] Is "declare function element()" allowed?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=8713

           Summary: [XQuery 1.0] Is "declare function element()" allowed?
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: jonathan.robie@redhat.com
        ReportedBy: mike@saxonica.com
         QAContact: public-qt-comments@w3.org


Test case K2-NameTest-84 is, in essence:

declare default function namespace "http://www.example.com/";
declare namespace e =  "http://www.example.com/";
declare function element()
{
    1
};
e:element()

The expected result is that the test is successful. This hinges on whether
"declare function element()" is an error on the grounds that the unprefixed
function name "element" is disallowed.

The spec can be read in two ways here. The extra-grammatical constraint
"reserved function names" (A1.2) states "Therefore it is not legal syntax for a
user to invoke functions with unprefixed names which match any of the names in
A.3 Reserved Function Names." This would imply that the syntax "element()" is
reserved only as a function call, and not as a declaration. However, section
A.3 states: "The following names are not allowed as function names in an
unprefixed form because expression syntax takes precedence", which would make
the above illegal. There's no particular reason to suppose that A.3 applies
only to function calls.


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Monday, 11 January 2010 17:49:02 UTC