- 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/w3c/dml
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.
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.
Imported modules:
- http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl
- http://www.zorba-xquery.com/modules/store/dynamic/collections/dml
For more details please also see:
- Data Lifecycle
- 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
- http://www.zorba-xquery.com/errors
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 |
![]() |
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 as xs:string
) as node()* The collection function returns the sequence of nodes of the collection identified by the given name. |
|
collection-name
(
$node as node()
) as xs:string This function returns the name of the collection the given node belongs to. |
|
![]() |
delete-node-first
(
$name as xs:string
) as The delete-node-first function is an updating function that deletes the first node from a collection. |
![]() |
delete-node-last
(
$name as xs:string
) as The delete-node-last function is an updating function that deletes the last node from a collection. |
![]() |
delete-nodes
(
$target as node()*
) as The delete-nodes function is an updating function that deletes zero of more nodes from a collection. |
![]() |
delete-nodes-first
(
$name as xs:string,
$number as xs:integer
) as 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
) as 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 The 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()*
) 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. |
![]() |
insert-nodes-before
(
$name as xs:string,
$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. |
![]() |
insert-nodes-first
(
$name as xs:string,
$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. |
![]() |
insert-nodes-last
(
$name as xs:string,
$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. |
declare 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.
- $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
declare 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.
- $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
declare 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.
- $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
declare 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.
- $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:string ) as node()*
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:ZDDY0009 If available collections does not provide a mapping for the URI $name.
declare function dml:collection-name ( $node as node() ) as xs:string
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 URI which identifies the collection to which the given node belongs to.
- zerr:ZDDY0011 if the given node does not belong to a collection.
declare function dml:delete-node-first ( $name as xs:string ) 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.
declare function dml:delete-node-last ( $name as xs:string ) 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 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 last node from the collection.
- zerr:ZDDY0009 If available collections does not provide a mapping for the URI $name.
- zerr:ZDDY0011 if the collection doesn't contain any node.
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. the collection identified by the $name parameter.
declare function dml:delete-nodes-first ( $name as xs:string, $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.
declare function dml:delete-nodes-last ( $name as xs:string, $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: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.
declare function dml:index-of ( $node as node() ) as xs:integer
The index-of function return the index of the given node in the collection.
- node The node to retrieve the index from.
- Returns the position as xs:integer of the given node in the collection.
- zerr:ZDDY0011 if node is not contained in any collection.
declare function dml:insert-nodes-after ( $name as xs:string, $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 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: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-nodes-before ( $name as xs:string, $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.
declare function dml:insert-nodes-first ( $name as xs:string, $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.
declare function dml:insert-nodes-last ( $name as xs:string, $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.