http://www.zorba-xquery.com/modules/store/static/collections/dml ZC

Module Description
Before using any of the functions below please remember to import the module namespace:
import module namespace cdml = "http://www.zorba-xquery.com/modules/store/static/collections/dml";

This modules provides a set of functions to modify a collection and retrieve the items contained in a particular collection.

This module is part of Zorba's XQuery Data Definition Facility. All the collections managed by this module have to be pre-declared in the prolog of a module. Please refer to the general documentation for more information and examples.

Author:

Nicolae Brinza, Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis

XQuery version and encoding for this module:

xquery version "3.0" encoding "utf-8";

Zorba version for this module:

The latest version of this module is 2.0. For more information about module versioning in Zorba please check out this resource.

Module Resources
Related Documentation

For more details please also see:

Namespaces
an http://www.zorba-xquery.com/annotations
cdml http://www.zorba-xquery.com/modules/store/static/collections/dml
ver http://www.zorba-xquery.com/options/versioning
zerr http://www.zorba-xquery.com/errors
Function Summary
Sequential External apply-insert ( $name as xs:QName, $content as item()* ) as item()*
This function does the same as the insert function except it immediately applies the resulting pending updates and returns the items that have been inserted.
Sequential External apply-insert-after ( $name as xs:QName, $pos as item(), $content as item()* ) as item()*
This function does the same as the insert-after function except it immediately applies the resulting pending updates and returns the items that have been inserted.
Sequential External apply-insert-before ( $name as xs:QName, $target as item(), $content as item()* ) as item()*
This function does the same as the insert-before function except it immediately applies the resulting pending updates and returns the items that have been inserted.
Sequential External apply-insert-first ( $name as xs:QName, $content as item()* ) as item()*
This function does the same as the insert-first function except it immediately applies the resulting pending updates and returns the items that have been inserted.
Sequential External apply-insert-last ( $name as xs:QName, $content as item()* ) as item()*
This function does the same as the insert-last function except it immediately applies the resulting pending updates and returns the items that have been inserted.
Sequential External apply-insert-nodes ( $name as xs:QName, $content as node()* ) as node()*
This function does the same as the insert-nodes function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.
Sequential External apply-insert-nodes-after ( $name as xs:QName, $pos as node(), $content as node()* ) as node()*
This function does the same as the insert-nodes-after function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.
Sequential External apply-insert-nodes-before ( $name as xs:QName, $target as node(), $content as node()* ) as node()*
This function does the same as the insert-nodes-before function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.
Sequential External apply-insert-nodes-first ( $name as xs:QName, $content as node()* ) as node()*
This function does the same as the insert-nodes-first function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.
Sequential External apply-insert-nodes-last ( $name as xs:QName, $content as node()* ) as node()*
This function does the same as the insert-nodes-last function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.
External collection ( $name as xs:QName ) as item()*
The collection function returns the sequence of nodes and/or json items that belong to the collection identified by the given name.
External collection ( $name as xs:QName, $skip as xs:integer ) as item()*
The collection function returns the sequence of nodes and/or json items that belong to the collection identified by the given name.
External collection ( $name as xs:QName, $start as xs:anyURI, $skip as xs:integer ) as item()*
The collection function returns the sequence of nodes and/or json items that belong to the collection identified by the given name.
External collection-name ( $item as item() ) as xs:QName
The collection-name function returns the name of the collection the given item (node or json item) belongs to.
Updating External delete ( $target as item()* ) as
The delete function is an updating function that deletes zero of more items (nodes and/or json items) from a collection.
Updating External delete-first ( $name as xs:QName ) as
The delete-first function is an updating function that deletes the first item from an ordered collection.
Updating External delete-first ( $name as xs:QName, $number as xs:integer ) as
The delete-first function is an updating function that deletes the first N items from an ordered collection.
Updating External delete-last ( $name as xs:QName ) as
The delete-last function is an updating function that deletes the last item from an ordered collection.
Updating External delete-last ( $name as xs:QName, $number as xs:integer ) as
The delete-last function is an updating function that deletes the last N items from an ordered collection.
Updating External delete-node-first ( $name as xs:QName ) as
The delete-node-first function is an updating function that deletes the first node from an ordered collection.
Updating External delete-node-last ( $name as xs:QName ) as
The delete-node-last function is an updating function that deletes the last node from an ordered collection.
Updating External delete-nodes ( $target as node()* ) as
The delete-nodes function is an updating function that deletes zero of more nodes from a collection.
Updating External delete-nodes-first ( $name as xs:QName, $number as xs:integer ) as
The delete-nodes-first function is an updating function that deletes the first n nodes from an ordered collection.
Updating External delete-nodes-last ( $name as xs:QName, $number as xs:integer ) as
The delete-nodes-last function is an updating function that deletes the last n nodes from an ordered collection.
Updating External edit ( $target as item(), $content as item() ) as
The edit function is an updating function that edits the first supplied item so as to make it look exactly like a copy of the second supplied item, while retaining its original identity.
External index-of ( $item as item() ) as xs:integer
The index-of function returns the position of the given item (node or json item) within its containing collection.
Updating External insert ( $name as xs:QName, $content as item()* ) as
The insert function is an updating function that inserts copies of the given items (nodes and/or json items) into a collection.
Updating External insert-after ( $name as xs:QName, $target as item(), $content as item()* ) as
The insert-after function is an updating function that inserts copies of the given items (nodes and/or json items) into a collection at the position directlry following the given target item.
Updating External insert-before ( $name as xs:QName, $target as item(), $content as item()* ) as
The insert-before function is an updating function that inserts copies of the given items (nodes and/or json items) into a collection at the position directly preceding the given target item.
Updating External insert-first ( $name as xs:QName, $content as item()* ) as
The insert-first function is an updating function that inserts copies of the given items (nodes and/or json items) at the beginning of a collection.
Updating External insert-last ( $name as xs:QName, $content as item()* ) as
The insert-last function is an updating function that inserts copies of the given items (nodes and/or json items) at the end of a collection.
Updating External insert-nodes ( $name as xs:QName, $content as node()* ) as
The insert-nodes function is an updating function that inserts copies of the given nodes into a collection.
Updating External insert-nodes-after ( $name as xs:QName, $target as node(), $content as node()* ) as
The insert-nodes-after function is an updating function that inserts copies of the given nodes into a collection at the position directlry following the given target node.
Updating External insert-nodes-before ( $name as xs:QName, $target as node(), $content as node()* ) as
The insert-nodes-before function is an updating function that inserts copies of the given nodes into a collection at the position directly preceding the given target node.
Updating External insert-nodes-first ( $name as xs:QName, $content as node()* ) as
The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of a collection.
Updating External insert-nodes-last ( $name as xs:QName, $content as node()* ) as
The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of a collection.
Updating External truncate ( $name as xs:QName ) as
The truncate function is an updating function that deletes the entire contents of collection.
Functions
Sequential External apply-insert back to 'Function Summary'
declare function cdml:apply-insert (
            $name as xs:QName,
            $content as item()*
) as item()*

This function does the same as the insert function except it immediately applies the resulting pending updates and returns the items that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-after back to 'Function Summary'
declare function cdml:apply-insert-after (
            $name as xs:QName,
            $pos as item(),
            $content as item()*
) as item()*

This function does the same as the insert-after function except it immediately applies the resulting pending updates and returns the items that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-before back to 'Function Summary'
declare function cdml:apply-insert-before (
            $name as xs:QName,
            $target as item(),
            $content as item()*
) as item()*

This function does the same as the insert-before function except it immediately applies the resulting pending updates and returns the items that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-first back to 'Function Summary'
declare function cdml:apply-insert-first (
            $name as xs:QName,
            $content as item()*
) as item()*

This function does the same as the insert-first function except it immediately applies the resulting pending updates and returns the items that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-last back to 'Function Summary'
declare function cdml:apply-insert-last (
            $name as xs:QName,
            $content as item()*
) as item()*

This function does the same as the insert-last function except it immediately applies the resulting pending updates and returns the items that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-nodes back to 'Function Summary'

Deprecated - please use the cdml:apply-insert#2 function

declare function cdml:apply-insert-nodes (
            $name as xs:QName,
            $content as node()*
) as node()*

This function does the same as the insert-nodes function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-nodes-after back to 'Function Summary'

Deprecated - please use the cdml:apply-insert-after#3 function

declare function cdml:apply-insert-nodes-after (
            $name as xs:QName,
            $pos as node(),
            $content as node()*
) as node()*

This function does the same as the insert-nodes-after function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-nodes-before back to 'Function Summary'

Deprecated - please use the cdml:apply-insert-before#3 function

declare function cdml:apply-insert-nodes-before (
            $name as xs:QName,
            $target as node(),
            $content as node()*
) as node()*

This function does the same as the insert-nodes-before function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-nodes-first back to 'Function Summary'

Deprecated - please use the cdml:apply-insert-first#2 function

declare function cdml:apply-insert-nodes-first (
            $name as xs:QName,
            $content as node()*
) as node()*

This function does the same as the insert-nodes-first function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.

Parameters:
Returns:
Errors:
See:

Sequential External apply-insert-nodes-last back to 'Function Summary'

Deprecated - please use the cdml:apply-insert-last#2 function

declare function cdml:apply-insert-nodes-last (
            $name as xs:QName,
            $content as node()*
) as node()*

This function does the same as the insert-nodes-last function except it immediately applies the resulting pending updates and returns the nodes that have been inserted.

Parameters:
Returns:
Errors:
See:

External collection back to 'Function Summary'
declare function cdml:collection (
            $name as xs:QName
) as item()*

The collection function returns the sequence of nodes and/or json items that belong to the collection identified by the given name.

Parameters:
Returns:
Errors:

External collection back to 'Function Summary'
declare function cdml:collection (
            $name as xs:QName,
            $skip as xs:integer
) as item()*

The collection function returns the sequence of nodes and/or json items that belong to the collection identified by the given name.

Parameters:
Returns:
Errors:

External collection back to 'Function Summary'
declare function cdml:collection (
            $name as xs:QName,
            $start as xs:anyURI,
            $skip as xs:integer
) as item()*

The collection function returns the sequence of nodes and/or json items that belong to the collection identified by the given name. The parameters $start and $skip can be used to skip over some items at the beginning of the collection. If both are given, both are applied: first $start to skip to the referenced item and then $skip to skip an additional number of items.

Parameters:
Returns:
Errors:

External collection-name back to 'Function Summary'
declare function cdml:collection-name (
            $item as item()
) as xs:QName

The collection-name function returns the name of the collection the given item (node or json item) belongs to.

Parameters:
Returns:
Errors:

Updating External delete back to 'Function Summary'
declare function cdml:delete (
            $target as item()*
) as 

The delete function is an updating function that deletes zero of more items (nodes and/or json items) from a collection.

Parameters:
Returns:
Errors:

Updating External delete-first back to 'Function Summary'
declare function cdml:delete-first (
            $name as xs:QName
) as 

The delete-first function is an updating function that deletes the first item from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-first back to 'Function Summary'
declare function cdml:delete-first (
            $name as xs:QName,
            $number as xs:integer
) as 

The delete-first function is an updating function that deletes the first N items from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-last back to 'Function Summary'
declare function cdml:delete-last (
            $name as xs:QName
) as 

The delete-last function is an updating function that deletes the last item from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-last back to 'Function Summary'
declare function cdml:delete-last (
            $name as xs:QName,
            $number as xs:integer
) as 

The delete-last function is an updating function that deletes the last N items from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-node-first back to 'Function Summary'

Deprecated - please use the cdml:delete-first#1 function

declare function cdml:delete-node-first (
            $name as xs:QName
) as 

The delete-node-first function is an updating function that deletes the first node from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-node-last back to 'Function Summary'

Deprecated - please use the cdml:delete-last#1 function

declare function cdml:delete-node-last (
            $name as xs:QName
) as 

The delete-node-last function is an updating function that deletes the last node from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-nodes back to 'Function Summary'

Deprecated - please use the cdml:delete#1 function

declare function cdml:delete-nodes (
            $target as node()*
) as 

The delete-nodes function is an updating function that deletes zero of more nodes from a collection.

Parameters:
Returns:
Errors:

Updating External delete-nodes-first back to 'Function Summary'

Deprecated - please use the cdml:delete-first#2 function

declare function cdml:delete-nodes-first (
            $name as xs:QName,
            $number as xs:integer
) as 

The delete-nodes-first function is an updating function that deletes the first n nodes from an ordered collection.

Parameters:
Returns:
Errors:

Updating External delete-nodes-last back to 'Function Summary'

Deprecated - please use the cdml:delete-last#2 function

declare function cdml:delete-nodes-last (
            $name as xs:QName,
            $number as xs:integer
) as 

The delete-nodes-last function is an updating function that deletes the last n nodes from an ordered collection.

Parameters:
Returns:
Errors:

Updating External edit back to 'Function Summary'
declare function cdml:edit (
            $target as item(),
            $content as item()
) as 

The edit function is an updating function that edits the first supplied item so as to make it look exactly like a copy of the second supplied item, while retaining its original identity.

Parameters:
Returns:
Errors:

External index-of back to 'Function Summary'
declare function cdml:index-of (
            $item as item()
) as xs:integer

The index-of function returns the position of the given item (node or json item) within its containing collection.

Parameters:
Returns:
Errors:

Updating External insert back to 'Function Summary'
declare function cdml:insert (
            $name as xs:QName,
            $content as item()*
) as 

The insert function is an updating function that inserts copies of the given items (nodes and/or json items) into a collection. Please note that the insertion position of the items in the collection is not defined.

Parameters:
Returns:
Errors:

Updating External insert-after back to 'Function Summary'
declare function cdml:insert-after (
            $name as xs:QName,
            $target as item(),
            $content as item()*
) as 

The insert-after function is an updating function that inserts copies of the given items (nodes and/or json items) into a collection at the position directlry following the given target item.

Parameters:
Returns:
Errors:

Updating External insert-before back to 'Function Summary'
declare function cdml:insert-before (
            $name as xs:QName,
            $target as item(),
            $content as item()*
) as 

The insert-before function is an updating function that inserts copies of the given items (nodes and/or json items) into a collection at the position directly preceding the given target item.

Parameters:
Returns:
Errors:

Updating External insert-first back to 'Function Summary'
declare function cdml:insert-first (
            $name as xs:QName,
            $content as item()*
) as 

The insert-first function is an updating function that inserts copies of the given items (nodes and/or json items) at the beginning of a collection.

Parameters:
Returns:
Errors:

Updating External insert-last back to 'Function Summary'
declare function cdml:insert-last (
            $name as xs:QName,
            $content as item()*
) as 

The insert-last function is an updating function that inserts copies of the given items (nodes and/or json items) at the end of a collection.

Parameters:
Returns:
Errors:

Updating External insert-nodes back to 'Function Summary'

Deprecated - please use the cdml:insert#2 function

declare function cdml:insert-nodes (
            $name as xs:QName,
            $content as node()*
) as 

The insert-nodes function is an updating function that inserts copies of the given nodes into a collection. Please note that the insertion position of the nodes in the collection is not defined.

Parameters:
Returns:
Errors:

Updating External insert-nodes-after back to 'Function Summary'

Deprecated - please use the cdml:insert-after#3 function

declare function cdml:insert-nodes-after (
            $name as xs:QName,
            $target as node(),
            $content as node()*
) as 

The insert-nodes-after function is an updating function that inserts copies of the given nodes into a collection at the position directlry following the given target node.

Parameters:
Returns:
Errors:

Updating External insert-nodes-before back to 'Function Summary'

Deprecated - please use the cdml:insert-before#3 function

declare function cdml:insert-nodes-before (
            $name as xs:QName,
            $target as node(),
            $content as node()*
) as 

The insert-nodes-before function is an updating function that inserts copies of the given nodes into a collection at the position directly preceding the given target node.

Parameters:
Returns:
Errors:

Updating External insert-nodes-first back to 'Function Summary'

Deprecated - please use the cdml:insert-first#2 function

declare function cdml:insert-nodes-first (
            $name as xs:QName,
            $content as node()*
) as 

The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of a collection.

Parameters:
Returns:
Errors:

Updating External insert-nodes-last back to 'Function Summary'

Deprecated - please use the cdml:insert-last#2 function

declare function cdml:insert-nodes-last (
            $name as xs:QName,
            $content as node()*
) as 

The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of a collection.

Parameters:
Returns:
Errors:

Updating External truncate back to 'Function Summary'
declare function cdml:truncate (
            $name as xs:QName
) as 

The truncate function is an updating function that deletes the entire contents of collection. Please note that applying this function can not be undone in case an error happens during the application of the containing PUL.

Parameters:
Returns:
Errors:

blog comments powered by Disqus