- 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
http://www.zorba-xquery.com/modules/fetch
import module namespace fetch = "http://www.zorba-xquery.com/modules/fetch";
This module provides functions to fetch the contents or the type of the content for a resource identified by a URI. For example, it fetches content for file or http resources if Zorba allows file or http access, respectively.
The errors raised by functions of this module have the namespace http://www.zorba-xquery.com/errors (associated with prefix zerr).
Matthias Brantner
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:
ann | http://www.zorba-xquery.com/annotations |
fetch | http://www.zorba-xquery.com/modules/fetch |
ver | http://www.zorba-xquery.com/options/versioning |
zerr | http://www.zorba-xquery.com/errors |
![]() |
content
(
$uri as xs:string
) as xs:string Tries to fetch the resource referred to by the given URI. |
![]() ![]() |
content
(
$uri as xs:string,
$entityKind as xs:string
) as xs:string external Tries to fetch the resource referred to by the given URI. |
declare %ann:streamable function fetch:content (
$uri as xs:string
) as xs:string
Tries to fetch the resource referred to by the given URI.
In order to retrieve the content, the functions uses the URI resolution and URL resolver process as documented at URI Resolvers. Therefore, it queries all URI mappers and resolvers with kind EntityData::SOME_CONTENT.
The function is annotated with the ann:streamable annotation, that is it returns a streamable string. A streamable string can only be consumed once. Please see section "Streamable Strings" in the documentation of Zorba's annotations.
- $uri the resource to fetch.
- the resource referred to by the given URI as streamble string.
- zerr:ZXQP0025 if the URI could not be resolved or did not resolve to a StreamResource.
declare %ann:streamable function fetch:content ( $uri as xs:string, $entityKind as xs:string ) as xs:string external
Tries to fetch the resource referred to by the given URI.
In order to retrieve the content, the functions uses the URI resolution and URL resolver process as documented at URI Resolvers. Therefore, it queries all URI mappers and resolvers with the specified entity kind.
The function is annotated with the ann:streamable annotation, that is it returns a streamable string. A streamable string can only be consumed once. Please see section "Streamable Strings" in the documentation of Zorba's annotations.
- $uri the resource to fetch.
- $entityKind the kind of resource to fetch.
- the resource referred to by the given URI as streamble string.
- zerr:ZXQP0025 if the URI could not be resolved or did not resolve to a StreamResource.