- All Modules
- All Functions
-
www.w3.org
- 2005
- XDM
- store
- introspection
- reflection
- external
-
xqdoc
-
xqdoc
(E)
-
project_xqdoc
- xqdoc2xhtml
-
xqdoc
(E)
- data processing
- expath.org
- www.functx.com
- debugger
- error
- jsoniq.org
- www.zorba-xquery.com
http://www.zorba-xquery.com/modules/store/dynamic/collections/dml
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.
Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
xquery version "3.0" encoding "utf-8";
The latest version of this module is 2.0. For more information about module versioning in Zorba please check out this resource.
- the XQuery module can be found here.
For more details please also see:
- Data Lifecycle
- http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl
- http://www.zorba-xquery.com/errors
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 |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() |
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. |
![]() |
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. |
![]() |
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. |
![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
delete-first
(
$name as xs:QName
) as The delete-first function is an updating function that deletes the first item from a collection. |
![]() ![]() |
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. |
![]() ![]() |
delete-last
(
$name as xs:QName
) as The delete-last function is an updating function that deletes the last item from a collection. |
![]() ![]() |
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. |
![]() ![]() |
The delete-node-first function is an updating function that deletes the first node from a collection. |
![]() ![]() |
The delete-node-last function is an updating function that deletes the last node from a collection. |
![]() ![]() |
The delete-nodes function is an updating function that deletes zero of more nodes from a collection. |
![]() ![]() |
The delete-nodes-first function is an updating function that deletes the first n nodes from a collection. |
![]() ![]() |
The delete-nodes-last function is an updating function that deletes the last n nodes from an ordered collection. |
![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
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. |
![]() ![]() |
The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of the collection. |
![]() ![]() |
The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of the collection. |
![]() ![]() |
truncate
(
$name as xs:QName
) as The truncate function is an updating function that deletes the entire contents of collection. |
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.
- $name The name of the collection to which the items should be added.
- $target The item in the collection after which the $content sequence should be inserted.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is the sequence of items that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-after
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.
- $name The name of the collection to which the items should be added.
- $target The item in the collection before which the $content sequence should be inserted.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is the sequence of items that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-before
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.
- $name The name of the collection to which the items should be added.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is the sequence of items that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-first
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.
- $name The name of the collection to which the items should be added.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is the sequence of items that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-last
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.
- $name The name of the collection to which the nodes should be added.
- $target The node in the collection after which the $content sequence should be inserted.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is the sequence of nodes that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-nodes-after
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.
- $name The name of the collection to which the nodes should be added.
- $target The node in the collection before which the $content sequence should be inserted.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is the sequence of nodes that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-nodes-before
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.
- $name The name of the collection to which the nodes should be added.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is the sequence of nodes that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-nodes-first
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.
- $name The name of the collection to which the nodes should be added.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is the sequence of nodes that have been inserted into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- dml:insert-nodes-last
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.
- $name The name of the collection.
- The sequence contained in the given collection.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
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.
- $name The name of the collection.
- $skip The number of collection items to skip.
- The sequence contained in the given collection.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
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.
- $name The name of the collection.
- $start A reference to the first item to return. All items before
- $skip The number of collection items to skip.
- The sequence contained in the given collection.
- zerr:ZAPI0028 If the given URI is not a valid node position computed by the np:node-position function.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
- zerr:ZSTR0066 If the passed reference $start does not reference a node from the collection identified by $name.
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.
- $item The item for which to get the name of the collection
- The result of this function is a QName which identifies the collection to which the given item belongs to.
- zerr:ZDDY0011 if the given item does not belong to a collection.
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.
- $target the items in the collection that should be deleted.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the items from their collections.
- zerr:ZDDY0011 if any item in the $target sequence is not a member of a collection or not all items of the $target sequence belong to the same collection.
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.
- $name The name of the collection from which the first item should be deleted.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the first item from the collection.
- zerr:ZDDY0011 if the collection doesn't contain any item.
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.
- $name The name of the collection from which the first N items should be deleted.
- $number The number N of items that should be removed from the beginning of the collection.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the items from the collection.
- zerr:ZDDY0011 if the collection doesn't contain the given number of items.
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.
- $name The name of the collection from which the last item should be deleted.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the last item from the collection.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
- zerr:ZDDY0011 if the collection doesn't contain any item.
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.
- $name The name of the collection from which the lsat N items should be deleted.
- $number The number N of items to delete.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the last N items.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
- zerr:ZDDY0011 if the collection doesn't contain the given number of items.
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.
- $name The name of the collection from which the first node should be deleted.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the first node from the collection.
- zerr:ZDDY0011 if the collection doesn't contain any node.
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.
- $name The name of the collection from which the last node should be deleted.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the last node from the collection.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
- zerr:ZDDY0011 if the collection doesn't contain any node.
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.
- $target the nodes in the collection that should be deleted.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the nodes from their collections.
- zerr:ZDDY0011 if any nodes in the $target sequence is not a member of a collection or not all nodes of the $target sequence belong to the same collection.
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.
- $name The name of the collection from which the first node should be deleted.
- $number The number of nodes that should be removed from the beginning of the collection.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the nodes from the collection.
- zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.
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.
- $name The name of the collection from which the first node should be deleted.
- $number The number of nodes to delete.
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the last n nodes.
- zerr:ZDDY0003 If available collections does not provide a mapping for the expanded QName $name.
- zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.
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.
- $item The item to retrieve the index from.
- Returns the position as xs:integer of the given item in the collection.
- zerr:ZDDY0011 if the item is not contained in any collection.
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.
- $name The name of the collection to which the items should be added.
- $target The item in the collection after which the $content sequence should be inserted.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the items into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0011 if the target node is not contained in the collection.
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.
- $name The name of the collection to which the items should be added.
- $target The item in the collection before which the $content sequence should be inserted.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the items into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0011 if the target item is not contained in the collection.
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.
- $name The name of the collection to which the items should be added.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the items into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
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.
- $name The name of the collection to which the items should be added.
- $content The sequences of items whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the items into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
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.
- $name The name of the collection to which the nodes should be added.
- $target The node in the collection after which the $content sequence should be inserted.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the nodes into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0011 if the target node is not contained in the collection.
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.
- $name The name of the collection to which the nodes should be added.
- $target The node in the collection before which the $content sequence should be inserted.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the nodes into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0011 if the target node is not contained in the collection.
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.
- $name The name of the collection to which the nodes should be added.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the nodes into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
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.
- $name The name of the collection to which the nodes should be added.
- $content The sequences of nodes whose copies should be added to the collection.
- The result of the function is an empty XDM instance and a pending update list which, once applied, inserts the nodes into the collection.
- zerr:ZDDY0003 if the collection identified by $name is not available.
declare function dml:truncate ( $name as xs:QName ) as
The truncate function is an updating function that deletes the entire contents of collection.
- $name The name of the collection whose content to delete
- The result of this function is an empty XDM instance and a pending update list which, once applied, deletes the nodes.
- zerr:ZDDY0003 if the collection identified by $name is not available.