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 5647 - [XQuery] Default collection
Summary: [XQuery] Default collection
Status: RESOLVED WORKSFORME
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 1.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Don Chamberlin
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL: http://www.w3.org/TR/xquery/
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-19 04:30 UTC by Mukul Gandhi
Modified: 2008-04-19 07:31 UTC (History)
0 users

See Also:


Attachments

Description Mukul Gandhi 2008-04-19 04:30:09 UTC
In the XQuery 1.0 specification, at http://www.w3.org/TR/xquery/

It's mentioned in section: "2.1.1 Static Context", the following point:

Statically known default collection type. This is the type of the sequence of nodes that would result from calling the fn:collection function with no arguments. Unless initialized to some other value by an implementation, the value of statically known default collection type is node()*.

Then in section, "2.4.4 Input Sources", it's mentioned:
The fn:collection function with zero arguments returns the default collection, an implementation-dependent sequence of nodes.

My question is:
What practical criterias can implementation consider, when returning non-null values from fn:collection function?

Should we not have simply said, nothing is returned (or, void) when fn:collection function is called with no arguments?

Regards,
Mukul
Comment 1 Mukul Gandhi 2008-04-19 04:33:48 UTC
(In reply to comment #0)
> What practical criterias can implementation consider, when returning non-null
> values from fn:collection function?

Sorry, I wanted to actually say:
What practical criterias can implementation consider, when returning non-null
values from fn:collection function, *when called with no arguments*?

Should we not have simply said, nothing is returned (or, void) when
fn:collection function is called with no arguments?

Regards,
Mukul
Comment 2 Michael Kay 2008-04-19 07:16:37 UTC
It was thought that some XML database products might allow your application to connect to a database using facilities in the API, and then use the collection() function (with no arguments) to mean "the database that I am connected to".

Equally, a filestore/memory implemementation might allow the contents of collection() to be bound from the command line - though that offers nothing that you couldn't get by binding a variable.
Comment 3 Mukul Gandhi 2008-04-19 07:31:42 UTC
(In reply to comment #2)
> It was thought that some XML database products might allow your application to
> connect to a database using facilities in the API, and then use the
> collection() function (with no arguments) to mean "the database that I am
> connected to".
> Equally, a filestore/memory implemementation might allow the contents of
> collection() to be bound from the command line - though that offers nothing
> that you couldn't get by binding a variable.

Thanks, Mike for the answer. I do agree with your explanation.

Regards,
Mukul