[xquery-talk] Dynamic context default values

John Snelson john.snelson at oracle.com
Wed Feb 7 20:23:46 PST 2007


Michael Kay wrote:
>> but I can't understand fn:collection() call (with zero 
>> arguments exactly) which should return default collection 
>> value from dynamic context. 
> 
> I think that's probably one of the features I added purely in order to pass
> the tests. I'm not sure the default collection is a particularly useful
> concept in most environments, but it isn't too hard to invent some way that
> allows users to bind the concept to something in their environment.

The default collection has turned out to be very useful for Berkeley DB 
XML. When you are using the interactive shell tool, there is always a 
current "container" (a storage primitive in BDB XML). When you query, 
the default collection is mapped to the current container. This allows 
you to prototype queries against this "container" more easily.

 From our API, we simply allow our users to assign a URI that will be 
used as the argument to collection() if no argument is given.

John


More information about the talk mailing list