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 27750 - [F+O 3.1] Determinism of uri-collection()
Summary: [F+O 3.1] Determinism of uri-collection()
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Functions and Operators 3.1 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
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: 2015-01-05 11:53 UTC by Michael Kay
Modified: 2015-02-10 17:07 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2015-01-05 11:53:12 UTC
The specification of collection() contains some careful language about determinism:

<quote>
By default, this function is ·deterministic·. This means that repeated calls on the function with the same argument will return the same result. However, for performance reasons, implementations may provide a user option to evaluate the function without a guarantee of determinism. The manner in which any such option is provided is ·implementation-defined·. If the user has not selected such an option, a call to this function must either return a deterministic result or must raise a dynamic error [err:FODC0003].
</quote>

There is no similar language for uri-collection(). As currently written, uri-collection() is required to be deterministic, full stop.

Perhaps this was done on the basis that caching a set of URIs for future use of the same collection URI is used again is more affordable than caching all the documents that result from dereferencing these URIs. However, having different rules makes life difficult for an implementation that wants to keep the implementations of collection() and uri-collection() closely aligned, perhaps by implementing collection() as uri-collection()!doc(.).

I think there is a strong case for adding the paragraph quoted above to the uri-collection() specification.
Comment 1 Michael Kay 2015-01-12 22:47:44 UTC
This change was agreed on 6 Jan 2015 and has been applied to the spec.