http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/dml
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/w3c/dml";This modules provides a set of functions to modify a collection and retrieve the nodes contained in a particular collection.
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/ddl
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
| an | http://www.zorba-xquery.com/annotations |
| ddl | http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl |
| dml | http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/dml |
| qdml | 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
apply-insert-nodes-after($name as xs:string, $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. | |
apply-insert-nodes-before($name as xs:string, $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. | |
apply-insert-nodes-first($name as xs:string, $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. | |
apply-insert-nodes-last($name as xs:string, $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. | |
collection-name($node as node()) as xs:stringThis function returns the name of the collection the given node belongs to. | |
collection($name as xs:string) as node()*The collection function returns the sequence of nodes of the collection identified by the given name. | |
delete-node-first($name as xs:string)The delete-node-first function is an updating function that deletes the first node from a collection. | |
delete-node-last($name as xs:string)The delete-node-last function is an updating function that deletes the last node from a collection. | |
delete-nodes-first($name as xs:string, $number as xs:integer)The delete-nodes-first function is an updating function that deletes the first n nodes from a collection. | |
delete-nodes-last($name as xs:string, $number as xs:integer)The delete-nodes-last function is an updating function that deletes the last n nodes from an ordered collection. | |
delete-nodes($target as node()*)The delete-nodes function is an updating function that deletes zero of more nodes from a collection. | |
index-of($node as node()) as xs:integerThe index-of function return the index of the given node in the collection. | |
insert-nodes-after($name as xs:string, $pos as node(), $content as node()*)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. | |
insert-nodes-before($name as xs:string, $target as node(), $content as 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. | |
insert-nodes-first($name as xs:string, $content as node()*)The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of the collection. | |
insert-nodes-last($name as xs:string, $content as node()*)The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of the collection. |
Functions
apply-insert-nodes-after#3
declare %an:sequential function dml:apply-insert-nodes-after(
$name as xs:string,
$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
$name as xs:stringThe name of the collection to which the nodes should be added.$pos as node()$content as node()The sequences of nodes whose copies should be added to the collection.
Returns
node()*The result of the function is the sequence of nodes that have been inserted into the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
See also
apply-insert-nodes-before#3
declare %an:sequential function dml:apply-insert-nodes-before(
$name as xs:string,
$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
$name as xs:stringThe name of the collection to which the nodes should be added.$target as node()The node in the collection before which the $content sequence should be inserted.$content as node()The sequences of nodes whose copies should be added to the collection.
Returns
node()*The result of the function is the sequence of nodes that have been inserted into the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
See also
apply-insert-nodes-first#2
declare %an:sequential function dml:apply-insert-nodes-first(
$name as xs:string,
$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
$name as xs:stringThe name of the collection to which the nodes should be added.$content as node()The sequences of nodes whose copies should be added to the collection.
Returns
node()*The result of the function is the sequence of nodes that have been inserted into the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
See also
apply-insert-nodes-last#2
declare %an:sequential function dml:apply-insert-nodes-last(
$name as xs:string,
$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
$name as xs:stringThe name of the collection to which the nodes should be added.$content as node()The sequences of nodes whose copies should be added to the collection.
Returns
node()*The result of the function is the sequence of nodes that have been inserted into the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
See also
collection-name#1
declare function dml:collection-name(
$node as node()
) as xs:stringThis function returns the name of the collection the given node belongs to.
Parameters
$node as node()The node for which to get the name of the collection
Returns
xs:stringThe result of this function is a URI which identifies the collection to which the given node belongs to.
Errors
- zerr:ZDDY0011 if the given node does not belong to a collection.
collection#1
declare function dml:collection(
$name as xs:string
) as node()*The collection function returns the sequence of nodes of the collection identified by the given name.
Parameters
$name as xs:stringThe name of the collection.
Returns
node()*The sequence contained in the given collection.
Errors
- zerr:ZDDY0009 If available collections does not provide a mapping for the URI $name.
delete-node-first#1
declare updating function dml:delete-node-first(
$name as xs:string
) as item()*The delete-node-first function is an updating function that deletes the first node from a collection.
Parameters
$name as xs:stringThe name of the collection from which the first node should be deleted.
Errors
- zerr:ZDDY0011 if the collection doesn't contain any node.
delete-node-last#1
declare updating function dml:delete-node-last(
$name as xs:string
) as item()*The delete-node-last function is an updating function that deletes the last node from a collection.
Parameters
$name as xs:stringThe name of the collection from which the first node should be deleted.
Errors
- zerr:ZDDY0009 If available collections does not provide a mapping for the URI $name.
- zerr:ZDDY0011 if the collection doesn't contain any node.
delete-nodes-first#2
declare updating function dml:delete-nodes-first(
$name as xs:string,
$number as xs:integer
) as item()*The delete-nodes-first function is an updating function that deletes the first n nodes from a collection.
Parameters
$name as xs:stringThe name of the collection from which the first node should be deleted.$number as xs:integerThe number of nodes that should be removed from the beginning of the collection.
Errors
- zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.
delete-nodes-last#2
declare updating function dml:delete-nodes-last(
$name as xs:string,
$number as xs:integer
) as item()*The delete-nodes-last function is an updating function that deletes the last n nodes from an ordered collection.
Parameters
$name as xs:stringThe name of the collection from which the first node should be deleted.$number as xs:integerThe number of nodes to delete.
Errors
- zerr:ZDDY0009 If available collections does not provide a mapping for the URI $name.
- zerr:ZDDY0011 if the collection doesn't contain the given number of nodes.
delete-nodes#1
declare updating function dml:delete-nodes(
$target as node()*
) as item()*The delete-nodes function is an updating function that deletes zero of more nodes from a collection.
Parameters
$target as node()the nodes in the collection that should be deleted.
Errors
- 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. the collection identified by the $name parameter.
index-of#1
declare function dml:index-of(
$node as node()
) as xs:integerThe index-of function return the index of the given node in the collection.
Parameters
$node as node()
Returns
xs:integerReturns the position as xs:integer of the given node in the collection.
Errors
- zerr:ZDDY0011 if node is not contained in any collection.
insert-nodes-after#3
declare updating function dml:insert-nodes-after(
$name as xs:string,
$pos as node(),
$content as node()*
) as item()*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
$name as xs:stringThe name of the collection to which the nodes should be added.$pos as node()$content as node()The sequences of nodes whose copies should be added to the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0011 if the target node is not contained in the collection.
insert-nodes-before#3
declare updating function dml:insert-nodes-before(
$name as xs:string,
$target as node(),
$content as node()*
) as item()*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
$name as xs:stringThe name of the collection to which the nodes should be added.$target as node()The node in the collection before which the $content sequence should be inserted.$content as node()The sequences of nodes whose copies should be added to the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0011 if the target node is not contained in the collection.
insert-nodes-first#2
declare updating function dml:insert-nodes-first(
$name as xs:string,
$content as node()*
) as item()*The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of the collection.
Parameters
$name as xs:stringThe name of the collection to which the nodes should be added.$content as node()The sequences of nodes whose copies should be added to the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.
insert-nodes-last#2
declare updating function dml:insert-nodes-last(
$name as xs:string,
$content as node()*
) as item()*The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of the collection.
Parameters
$name as xs:stringThe name of the collection to which the nodes should be added.$content as node()The sequences of nodes whose copies should be added to the collection.
Errors
- zerr:ZDDY0003 if the collection identified by $name is not available.