<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>8713</bug_id>
          
          <creation_ts>2010-01-11 17:48:59 +0000</creation_ts>
          <short_desc>[XQuery 1.0] Is &quot;declare function element()&quot; allowed?</short_desc>
          <delta_ts>2010-02-16 19:40:44 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XQuery 3.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          <cc>jmdyck</cc>
    
    <cc>john.snelson</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>30934</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2010-01-11 17:48:59 +0000</bug_when>
    <thetext>Test case K2-NameTest-84 is, in essence:

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

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

The spec can be read in two ways here. The extra-grammatical constraint &quot;reserved function names&quot; (A1.2) states &quot;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.&quot; This would imply that the syntax &quot;element()&quot; is reserved only as a function call, and not as a declaration. However, section A.3 states: &quot;The following names are not allowed as function names in an unprefixed form because expression syntax takes precedence&quot;, which would make the above illegal. There&apos;s no particular reason to suppose that A.3 applies only to function calls.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>30943</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Dyck">jmdyck</who>
    <bug_when>2010-01-11 21:42:16 +0000</bug_when>
    <thetext>(This relates to Bug 7036.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31657</commentid>
    <comment_count>2</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2010-02-09 12:13:47 +0000</bug_when>
    <thetext>Like Saxon, XQilla does not pass this test, but it would be simple to change that. I&apos;m in favour of making reserved function names only applicable to function calls, since I believe that defining unprefixed module functions is a common pattern that we have no technical reason to restrict.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32203</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2010-02-16 19:35:35 +0000</bug_when>
    <thetext>Today we agreed to change:

  &quot;Therefore it is not legal syntax for a user to invoke functions
  with unprefixed names which match any of the names&quot; 

to:

  &quot;Therefore, an unprefixed function name must not be any of the names
  in A.3 Reserved Function Names&quot;

This change will be made in XQuery 1.1. 

Our intent in 1.0 was to disallow such names in both function declarations and invocations. We will revise the 1.0 tests to allow either error or success.

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>