fn:collection() as node()*
fn:collection($arg as xs:string?) as node()*
Returns a sequence of nodes obtained by interpreting $arg as an xs:anyURI. If $arg is not specified, the default collection is used if it is set. See the specification for details.Parameters
A URI representing an Berkeley DB XML container is of the form, "dbxml:/container_alias," where "container_alias" is an absolute or relative path to the container, or an alias added using XmlContainer::addAlias. If the URI is either of the form "dbxml:////absolute_path_to_container" or "dbxml:/C:/absolute_windows_path_to_container" (Windows) then the path is considered absolute; otherwise, it is relative to the Berkeley DB environment's data directory. In general, it's simplest to use an explicit alias. It is also important to note that the Berkeley DB XML query optimizer uses the argument to fn:collection() to determine which indices may be appropriate for a given query.
By default, the base URI in an XmlQueryContext is "dbxml:/" which allows use of "collection('relative_path_to_container')" without any additional code. It is possible to use XmlQueryContext::setBaseURI to change the default base URI. Note also that the Windows pathname separator, '\', is not a valid separator in a URI; the forward slash ('/') must be used, even on Windows.
Some applications may choose to implement their own name resolution scheme for the argument to fn:collection(). This is supported by allowing applications to control the resolution process using an application-provided instance of the XmlResolver class, and using a URI that looks like (for example) "myscheme:/my_name_for_container." Collections located in this manner cannot currently be optimized by indices.
Copyright (c) 1996-2009 Oracle. All rights reserved.