<?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>17598</bug_id>
          
          <creation_ts>2012-06-26 11:45:32 +0000</creation_ts>
          <short_desc>[XQ31ReqUC] Function namespace search path</short_desc>
          <delta_ts>2014-05-20 16:58:29 +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>Requirements for Future Versions</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></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="John Snelson">john.snelson</reporter>
          <assigned_to name="Jim Melton">jim.melton</assigned_to>
          <cc>jim.melton</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>69398</commentid>
    <comment_count>0</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2012-06-26 11:45:32 +0000</bug_when>
    <thetext>Only having a single default function namespace forces the use of most XQuery functions to have prefixed names. This becomes a burden on users, especially when they have a set of namespaces that they use frequently.

Other languages (like Java) allow functions or classes to be imported into the global namespace, and can therefore use such functions without fully qualifying them.

I suggest introducing a namespace search path, which users can add namespaces to with a new &quot;using&quot; syntax:

using namespace &quot;http://snelson.org.uk/functional&quot;;
using module &quot;http://snelson.org.uk/functional&quot; at &quot;functional.xq&quot;;

Any unprefixed name in a function call or literal function expression will resolve the function in the following way:

1) If a function is found in the default function namespace with the correct arity and localname, that is chosen.

2) Otherwise, a set of functions is built by looking for functions using each of the namespace URIs in the namespace search path. If this set is empty, or if it contains more than one function, an error is raised.

Also see https://www.w3.org/Bugs/Public/show_bug.cgi?id=10175</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106480</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-05-20 16:58:29 +0000</bug_when>
    <thetext>Assigning to future requirements per Working Group decision (https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Oct/0087.html).</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>