[Bug 2553] [F+O] Stability of collection()

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2553





------- Additional Comments From davidc@nag.co.uk  2005-12-03 22:35 -------
(In reply to comment #3)
> Re. David's comment that similar considerations should apply to doc() and XSLT's
> document(), and the reference to Saxon's discard-document() extension function.
> 
> This is fundamentally unsound, I believe.
> 

Yes but your comments re soundness apply equally to collection(), so I don't
think you were really disagreeing with my comment that doc() and collection()
could be considered equally.

I was going to answer (but I see Michael already made a similar suggestion)
that the solution may be along the lines of having a mode that drops the
requiremnt that the same nodes are returned if you call doc() twice with the
same uri. 

There are use cases where the guaranteed stability is a good thing but it isn't
really an essential part of the language. Other functions that generate nodes do
not have this feature.  A function definition like

declare function x:f () {<x/>}

means that x:f() returns a new node each time, so it is not a pure function in
that sense. A mode in which doc() acted the same way, would be very useful I think.

David

Received on Saturday, 3 December 2005 22:35:54 UTC