http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl
Description
Before using any of the functions below please remember to import the module namespace:
import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl";This modules defines a set of functions for managing persistent, ordered, and updatable collections.
Such collections are identified by a URI as defined in the XQuery specification. However, please note that we do not advice users to use collections identified by URIs. Instead, we refer to the data lifecycle documentation. It gives an overview over serveral ways to work with collections, documents, and other data-structures.
See also
http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/dml
http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl
http://www.zorba-xquery.com/modules/store/dynamic/collections/dml
Author
Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
XQuery version and encoding
xquery version "3.0" encoding "utf-8";
Namespaces
| ddl | http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl |
| qddl | http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl |
| ver | http://www.zorba-xquery.com/options/versioning |
| zerr | http://www.zorba-xquery.com/errors |
Function Summary
available-collections() as xs:string*The function returns a sequence of URIs of the collections that are available. | |
create($coll-name as xs:string)The create function is an updating function which creates the collection with the given URI and the empty-sequence as contents. | |
create($coll-name as xs:string, $content as node()*)The create function is an updating function which creates the collection with the given URI. | |
delete($coll-name as xs:string)The delete function is an updating function that removes the collection with the given URI. | |
from-qname($name as xs:QName) as xs:stringFunction used for internal purposes only. | |
is-available-collection($coll-name as xs:string) as xs:booleanThe function returns true if a collection with the given URI is available (i. | |
to-qname($name as xs:string) as xs:QNameFunction used for internal purposes only. |
Functions
available-collections#0
declare function ddl:available-collections() as xs:string*
The function returns a sequence of URIs of the collections that are available. The sequence will be empty if there are no collections.
Returns
xs:string*A sequence of URIs, one for each available collection, or an emtpy sequence.
create#1
declare updating function ddl:create(
$coll-name as xs:string
) as item()*The create function is an updating function which creates the collection with the given URI and the empty-sequence as contents.
Parameters
$coll-name as xs:string
Errors
- zerr:ZDDY0002 if a collection with the given URI already exists.
create#2
declare updating function ddl:create(
$coll-name as xs:string,
$content as node()*
) as item()*The create function is an updating function which creates the collection with the given URI. Moreover, it adds copies of the sequence $content to the new collection.
Parameters
$coll-name as xs:string$content as node()The sequences of nodes that should be added to the new collection.
Errors
- zerr:ZDDY0002 if a collection with the given URI already exists.
delete#1
declare updating function ddl:delete(
$coll-name as xs:string
) as item()*The delete function is an updating function that removes the collection with the given URI.
Parameters
$coll-name as xs:string
Errors
- zerr:ZDDY0003 if the URI $name is not equal to any of the available collections.
- zerr:ZDDY0015 if any of the in-scope variables references a node that belongs to the collection with the given URI.
from-qname#1
declare function ddl:from-qname(
$name as xs:QName
) as xs:stringFunction used for internal purposes only. It returns the namespace component of the given QName.
Parameters
$name as xs:QNameQName whose namespace component should be returned
Returns
xs:stringthe namespace componentn of the given QName
is-available-collection#1
declare function ddl:is-available-collection(
$coll-name as xs:string
) as xs:booleanThe function returns true if a collection with the given URI is available (i.e. has been created).
Parameters
$coll-name as xs:string
Returns
xs:booleantrue if the collection is available and false otherwise.
to-qname#1
declare function ddl:to-qname(
$name as xs:string
) as xs:QNameFunction used for internal purposes only. It converts a URI given as string into a reserved QName. This QName is used in the module to be able to store collections identified by URIs using dynamic collections which are identified by QNames.
Parameters
$name as xs:stringURI to convert to a reserved QName.
Returns
xs:QNameThe reserved QName for the given URI.