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

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

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

Please refer to our documentation for more information about the lifecycle management and the manipulation of such collections.

Author:

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
dml http://www.zorba-xquery.com/modules/store/dynamic/collections/dml
ver http://www.zorba-xquery.com/options/versioning
zerr http://www.zorba-xquery.com/errors
Function Summary
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-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 a 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 a collection.
Updating External delete-last ( $name as xs:QName ) as
The delete-last function is an updating function that deletes the last item from a 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 a 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 a 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 a 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 the collection.
Updating External insert-after ( $name as xs:QName, $pos 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 directly 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 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 or json items) at the beginning of the 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 or json items) at the end of the collection.
Updating External insert-nodes-after ( $name as xs:QName, $pos 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 directly 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 the 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 the 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-after back to 'Function Summary'
declare function dml: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 dml: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 dml: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 dml: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-after back to 'Function Summary'

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

declare function dml: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 dml: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 dml: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 dml: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 dml: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 dml: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 dml: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 dml: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 dml: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 dml:delete-first (
            $name as xs:QName
) as 

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

Parameters:
Returns:
Errors:

Updating External delete-first back to 'Function Summary'
declare function dml: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 a collection.

Parameters:
Returns:
Errors:

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

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

Parameters:
Returns:
Errors:

Updating External delete-last back to 'Function Summary'
declare function dml: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 dml:delete-node-first (
            $name as xs:QName
) as 

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

Parameters:
Returns:
Errors:

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

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

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

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

Parameters:
Returns:
Errors:

Updating External delete-nodes back to 'Function Summary'

Deprecated - please use the cdml:delete#1 function

declare function dml: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 dml: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 a collection.

Parameters:
Returns:
Errors:

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

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

declare function dml: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 dml: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 dml: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 the collection.

Parameters:
Returns:
Errors:

Updating External insert-after back to 'Function Summary'
declare function dml:insert-after (
            $name as xs:QName,
            $pos 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 directly following the given target item.

Parameters:
Returns:
Errors:

Updating External insert-before back to 'Function Summary'
declare function dml: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 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 dml: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 or json items) at the beginning of the collection.

Parameters:
Returns:
Errors:

Updating External insert-last back to 'Function Summary'
declare function dml: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 or json items) at the end of the collection.

Parameters:
Returns:
Errors:

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

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

declare function dml:insert-nodes-after (
            $name as xs:QName,
            $pos 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 directly 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 dml: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 dml: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 the collection.

Parameters:
Returns:
Errors:

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

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

declare function dml: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 the collection.

Parameters:
Returns:
Errors:

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

The truncate function is an updating function that deletes the entire contents of collection.

Parameters:
Returns:
Errors: