[Bug 17598] New: Function namespace search path

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17598

           Summary: Function namespace search path
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.1 Requirements and Use Cases
        AssignedTo: jonathan.robie@gmail.com
        ReportedBy: john.snelson@marklogic.com
         QAContact: public-qt-comments@w3.org


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 "using" syntax:

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

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

-- 
Configure bugmail: https://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 Tuesday, 26 June 2012 11:45:39 UTC