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 10175 - Using multiple default namespaces
Summary: Using multiple default namespaces
Status: CLOSED LATER
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 enhancement
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-15 15:37 UTC by John Snelson
Modified: 2014-05-15 14:00 UTC (History)
1 user (show)

See Also:


Attachments

Description John Snelson 2010-07-15 15:37:48 UTC
There are often a number of function namespaces that a stylesheet will use with frequency. All but one of these namespaces currently need qualifying when used, since there is only one default function namespace.

In other languages like Java, importing a namespace will bring the names from that namespace into the current scope. This allows them to be used without qualifying them with the namespace.

I propose that we add a new attribute (maybe "using", or "using-function-namespaces"), which lists a set of namespaces, NS. When referencing a function with a QName L that doesn't have a prefix, the namespaces in NS are tried in turn looking for a function with a localname of L. If two or more such functions exist, an error is raised. To avoid the error the user should qualify the function reference with a prefix.
Comment 1 Michael Kay 2010-07-15 16:00:27 UTC
Noted: as an extension of this idea:

(a) similarly, any prefix could be bound to a set or list of namespaces

(b) the same mechanism could be used for names other than function names. For example if two variants/versions of an XML vocabulary have been defined in different namespaces, a QName could effectively refer to the union of the two namespaces, allowing the same query/stylesheet to work with both.
Comment 2 Jirka Kosek 2011-03-24 15:22:34 UTC
I like Mike's extension. It should be also possible to include names which are not in any namespace into "search path". For example to handle DocBook 4.5 (not in namespace) and 5 (has namespace) at the same time.
Comment 3 Michael Kay 2011-06-08 21:30:43 UTC
The minutes of the Prague F2F (March 2011) record:

DECIDED at 7 Oct. 2010 telcon: to close bug 10175 (for now) with status LATER.

Which I am now belatedly doing.