http://www.zorba-xquery.com/modules/node-reference ZC

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

The module provides functions to compute an immutable and opaque reference for any node and to retrieve nodes given their identifier. The identifiers are immutable, i.e. a node identifier does not change during the node lifetime and cannot be reused for another node after the original node gets deleted. Identifiers are unique, in that, two different nodes will never have the same identifier. A node, at any time during its lifetime, can be retrieved by its identifier.

Please see the data lifecycle documentation about details on storing nodes in collections or as documents.

Author:

Federico Cavalieri

XQuery version and encoding for this module:

xquery version "1.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
ref http://www.zorba-xquery.com/modules/node-reference
ver http://www.zorba-xquery.com/options/versioning
zerr http://www.zorba-xquery.com/errors
Function Summary
External node-by-reference ( $arg as xs:anyURI ) as node()? external
Returns the node identified by the given node reference.
External node-reference ( $arg as node() ) as xs:anyURI external
Returns an immutable and opaque node reference (with type xs:anyURI) for a given node.
Functions
External node-by-reference back to 'Function Summary'
declare function ref:node-by-reference (
            $arg as xs:anyURI 
 ) as node()? external

Returns the node identified by the given node reference.

The function returns the empty sequence if the node that is referenced does not exist.

Parameters:
Returns:
Errors:

External node-reference back to 'Function Summary'
declare function ref:node-reference (
            $arg as node() 
 ) as xs:anyURI external

Returns an immutable and opaque node reference (with type xs:anyURI) for a given node.

The generated identifier is immutable, i.e. a node identifier does not change during the node lifetime and cannot be reused for another node after the original node gets deleted.

Identifiers are also unique, in that, two different nodes will never have the same identifier.

A node, at any time during its lifetime, can be retrieved by its identifier, using the ref:node-by-reference function.

Parameters:
Returns:

blog comments powered by Disqus