- All Modules
- All Functions
-
www.w3.org
- 2005
- XDM
- store
- introspection
- reflection
- external
-
xqdoc
-
project_xqdoc
-
xqdoc
(E)
- xqdoc2xhtml
-
project_xqdoc
- data processing
- expath.org
- www.functx.com
- error
http://www.zorba-xquery.com/modules/store/static/collections/dml
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 nodes 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.
Nicolae Brinza, Matthias Brantner, David Graf, Till Westmann, Markos Zaharioudakis
xquery version "3.0" encoding "utf-8";
- the XQuery module can be found here.
For more details please also see:
- Data Lifecycle
- XQuery Data Definition Facility
- http://www.zorba-xquery.com/modules/store/static/collections/ddl
- http://www.zorba-xquery.com/modules/store/static/indexes/ddl
- http://www.zorba-xquery.com/modules/store/static/indexes/dml
- http://www.zorba-xquery.com/modules/store/static/integrity_constraints/ddl
- http://www.zorba-xquery.com/modules/store/static/integrity_constraints/dml
- http://www.zorba-xquery.com/errors
ann | 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 |
![]() ![]() |
apply-insert-nodes
(
$name as xs:QName,
$content as node()*
) as node()* external 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-after
(
$name as xs:QName,
$pos as node(),
$content as node()*
) as node()* external 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:QName,
$target as node(),
$content as node()*
) as node()* external 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:QName,
$content as node()*
) as node()* external 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. |
![]() ![]() |
apply-insert-nodes-last
(
$name as xs:QName,
$content as node()*
) as node()* external 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 node()* external The collection function returns the sequence of nodes of the collection identified by the given name. |
![]() |
collection-name
(
$node as node()
) as xs:QName external This function returns the name of the collection the given node belongs to. |
![]() ![]() |
delete-node-first
(
$name as xs:QName
) external The delete-node-first function is an updating function that deletes the first node from an ordered collection. |
![]() ![]() |
delete-node-last
(
$name as xs:QName
) external The delete-node-last function is an updating function that deletes the last node from an ordered collection. |
![]() ![]() |
delete-nodes
(
$target as node()*
) external The delete-nodes function is an updating function that deletes zero of more nodes from a collection. |
![]() ![]() |
delete-nodes-first
(
$name as xs:QName,
$number as xs:integer
) external The delete-nodes-first function is an updating function that deletes the first n nodes from an ordered collection. |
![]() ![]() |
delete-nodes-last
(
$name as xs:QName,
$number as xs:integer
) external The delete-nodes-last function is an updating function that deletes the last n nodes from an ordered collection. |
![]() |
index-of
(
$node as node()
) as xs:integer external The index-of function that returns the position of the node in its collection. |
![]() ![]() |
insert-nodes
(
$name as xs:QName,
$content as node()*
) external The insert-nodes function is an updating function that inserts copies of the given nodes into a collection. |
![]() ![]() |
insert-nodes-after
(
$name as xs:QName,
$target as node(),
$content as node()*
) external 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:QName,
$target as node(),
$content as node()*
) external 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:QName,
$content as node()*
) external The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of a collection. |
![]() ![]() |
insert-nodes-last
(
$name as xs:QName,
$content as node()*
) external The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of a collection. |
declare %ann:sequential function cdml:apply-insert-nodes ( $name as xs:QName, $content as node()* ) as node()* external
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.
- $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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is append-only, const, or queue.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
- cdml:insert-nodes
declare %ann:sequential function cdml:apply-insert-nodes-after ( $name as xs:QName, $pos as node(), $content as node()* ) as node()* external
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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const, append-only, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
- zerr:ZDDY0011 if the $target node is not a node that is contained in the collection $name.
- cdml:insert-nodes-after
declare %ann:sequential function cdml:apply-insert-nodes-before ( $name as xs:QName, $target as node(), $content as node()* ) as node()* external
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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const, append-only, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
- zerr:ZDDY0011 if the $target node is not a node that is contained in the collection $name.
- cdml:insert-nodes-before
declare %ann:sequential function cdml:apply-insert-nodes-first ( $name as xs:QName, $content as node()* ) as node()* external
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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is append-only, const, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type according to the rules for SequenceType Matching.
- cdml:insert-nodes-first
declare %ann:sequential function cdml:apply-insert-nodes-last ( $name as xs:QName, $content as node()* ) as node()* external
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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
- cdml:insert-nodes-last
declare function cdml:collection (
$name as xs:QName
) as node()* external
The collection function returns the sequence of nodes of the collection identified by the given name.
- $name The name of the collection.
- The sequence contained in the given collection.
- zerr:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
declare function cdml:collection-name (
$node as node()
) as xs:QName external
This function returns the name of the collection the given node belongs to.
- $node The node 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 node belongs to.
- zerr:ZDDY0011 if the given node does not belong to a collection.
declare updating function cdml:delete-node-first (
$name as xs:QName
) external
The delete-node-first function is an updating function that deletes the first node from an ordered 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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const or append-only.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDDY0011 If the collection is empty.
declare updating function cdml:delete-node-last (
$name as xs:QName
) external
The delete-node-last function is an updating function that deletes the last node from an ordered 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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const, append-only, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDDY0011 If the collection is empty.
declare updating function cdml:delete-nodes (
$target as node()*
) external
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:ZDDY0006 if the modifier property of the collection $name is const, append-only,
- zerr:ZDTY0001 if $content does not match the expected type according to the rules for SequenceType Matching.
- 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.
declare updating function cdml:delete-nodes-first ( $name as xs:QName, $number as xs:integer ) external
The delete-nodes-first function is an updating function that deletes the first 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 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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const or append-only.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDDY0011 If the collection contains less than $number nodes.
declare updating function cdml:delete-nodes-last ( $name as xs:QName, $number as xs:integer ) external
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 nodes.
- zerr:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDDY0011 If the collection contains less than $number nodes.
declare function cdml:index-of (
$node as node()
) as xs:integer external
The index-of function that returns the position of the node in its collection.
- $node The node to retrieve the index for.
- Returns the position as xs:integer of the given node in the collection.
- zerr:ZDDY0011 if the node is not stored in any collection.
- zerr:ZDDY0012 if the order property of collection of that node is unordered.
declare updating function cdml:insert-nodes ( $name as xs:QName, $content as node()* ) external
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.
- $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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is append-only, const, or queue.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
declare updating function cdml:insert-nodes-after ( $name as xs:QName, $target as node(), $content as node()* ) external
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.
- $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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const, append-only, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
- zerr:ZDDY0011 if the $target node is not a node that is contained in the collection $name.
declare updating function cdml:insert-nodes-before ( $name as xs:QName, $target as node(), $content as node()* ) external
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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const, append-only, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
- zerr:ZDDY0011 if the $target node is not a node that is contained in the collection $name.
declare updating function cdml:insert-nodes-first ( $name as xs:QName, $content as node()* ) external
The insert-nodes-first function is an updating function that inserts copies of the given nodes at the beginning of a 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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is append-only, const, or queue.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.
declare updating function cdml:insert-nodes-last ( $name as xs:QName, $content as node()* ) external
The insert-nodes-last function is an updating function that inserts copies of the given nodes at the end of a 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:ZDDY0001 if the collection identified by $name is not declared.
- zerr:ZDDY0003 if the collection identified by $name is not available.
- zerr:ZDDY0006 if the modifier property of the collection $name is const.
- zerr:ZDDY0012 if the order property of the collection $name is unordered.
- zerr:ZDTY0001 if $content does not match the expected type (i.e. declared by the collection) according to the rules for SequenceType Matching.