http://www.zorba-xquery.com/modules/fetch ZC

Module Description
Before using any of the functions below please remember to import the module namespace:
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).

Author:

Matthias Brantner

XQuery version and encoding for this module:

xquery version "3.0" encoding "utf-8";

Module Resources
Related Documentation

For more details please also see:

Namespaces
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
Function Summary
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.
Functions
content back to 'Function Summary'
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.

Parameters:
Returns:
Errors:
See:

content back to 'Function Summary'
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.

Parameters:
Returns:
Errors:
See:

blog comments powered by Disqus