- 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
- debugger
- error
- www.zorba-xquery.com
http://www.zorba-xquery.com/modules/store/dynamic/documents
import module namespace doc = "http://www.zorba-xquery.com/modules/store/dynamic/documents";
This module defines a set of functions which manage documents that are persisted in the store. Specifically, it contains functions to put, remove, list, or retrieve documents.
Please refer to our documentation for more information about the lifecycle management and manipulation of documents.
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:
doc | http://www.zorba-xquery.com/modules/store/dynamic/documents |
err | http://www.w3.org/2005/xqt-errors |
ver | http://www.zorba-xquery.com/options/versioning |
zerr | http://www.zorba-xquery.com/errors |
![]() |
available-documents
(
) as xs:string* external Retrieves a sequence of URIs of documents bound in the store. |
![]() |
document
(
$uri as xs:string
) as document() external Returns the document with the given URI from the store. |
![]() |
is-available-document
(
$uri as xs:string
) as xs:boolean external Returns true if a document with the given URI exists in the store. |
![]() ![]() |
put
(
$uri as xs:string,
$doc as document()
) external Adds a document to the store. |
![]() ![]() |
remove
(
$uri as xs:string
) external Removes the document with the given URI from the store. |
declare function doc:available-documents ( ) as xs:string* external
Retrieves a sequence of URIs of documents bound in the store.
- The list of URIs of the available documents in the store. The empty sequence is returned if not document exists in the store.
declare function doc:document (
$uri as xs:string
) as document() external
Returns the document with the given URI from the store. The difference to fn:doc is that this function does not attempt to retrieve the resource from the file system or the web before returning it. Its only responsibility is to return the document from the store that was bound using fn:put or doc:put.
- $uri The URI of the document to retrieve. If a relative URI is given, the URI is made absolute using the static base URI of the module.
- Returns the document bound to the given URI.
- zerr:ZXQD0002 if no document with the given URI exists in the store.
- err:FODC0004 if the given URI is not valid or couldn't be absolutized.
declare function doc:is-available-document (
$uri as xs:string
) as xs:boolean external
Returns true if a document with the given URI exists in the store.
- $uri The URI of the document to check for. If a relative URI is given, the URI is made absolute using the static base URI of the module.
- Returns true if a document with the given URI exists in the store or false otherwise.
- err:FODC0004 if the given URI is not valid or couldn't be absolutized.
declare updating function doc:put ( $uri as xs:string, $doc as document() ) external
Adds a document to the store. The document is bound to the URI given as first parameter. This URI is the name of the document and can be used by the doc:document() function to retrieve the document from the store. The semantics of the function is similar to the fn:put function. The difference is that this function accepts only document nodes as parameters. Please note that this function does not try to fetch the document from the external resource identified by $uri. Instead, the file or http-client modules can be used to retrieve the resource as string and fn:parse-xml can be used to parse the string returning a document.
- $uri The URI of the document. If a relative URI is given, the URI is made absolute using the static base URI of the module.
- $doc The document node to be added to the store.
- an empty XDM instance and a pending update list which, when applied, adds the given document to the store.
- zerr:ZAPI0020 if the store already contains a document for the given $uri.
- err:FODC0004 if the given URI is not valid or couldn't be absolutized.
declare updating function doc:remove (
$uri as xs:string
) external
Removes the document with the given URI from the store.
- $uri The URI of the document to remove. If a relative URI is given, the URI is made absolute using the static base URI of the module.
- Returns an empty XDM instance and a pending update list which, when applied, removes the document bound to the given URI.
- zerr:ZXQD0002 if no document with the given URI exists in the store.
- err:FODC0004 if the given URI is not valid or couldn't be absolutized.