This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17598 - [XQ31ReqUC] Function namespace search path
Summary: [XQ31ReqUC] Function namespace search path
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Requirements for Future Versions (show other bugs)
Version: Working drafts
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-26 11:45 UTC by John Snelson
Modified: 2014-05-20 16:58 UTC (History)
1 user (show)

See Also:


Attachments

Description John Snelson 2012-06-26 11:45:32 UTC
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
Comment 1 Jonathan Robie 2014-05-20 16:58:29 UTC
Assigning to future requirements per Working Group decision (https://lists.w3.org/Archives/Member/w3c-xsl-query/2012Oct/0087.html).