http://zorba.io/modules/fetch

View as XML or JSON.

This module provides functions to fetch the content of a resource identified by a URI. For example, it fetches the content of file or http resources.

In order to retrieve such content, the functions use the URI resolution and URL resolver process as documented at URI Resolvers.

Function Summary

content-binary ($uri as xs:string) as xs:base64Binary

Tries to fetch the resource referred to by the given URI and returning it as base64Binary.

content-binary ($uri as xs:string, $entity-kind as xs:string) as xs:base64Binary external

Tries to fetch the resource referred to by the given URI and returning it as base64Binary.

content ($uri as xs:string) as xs:string

Tries to fetch the resource referred to by the given URI.

content ($uri as xs:string, $entity-kind as xs:string) as xs:string

Tries to fetch the resource referred to by the given URI.

content ($uri as xs:string, $entity-kind as xs:string, $encoding as xs:string) as xs:string external

Tries to fetch the resource referred to by the given URI.

Functions

content-binary#1

declare  %an:streamable function fetch:content-binary($uri as xs:string) as xs:base64Binary

Tries to fetch the resource referred to by the given URI and returning it as base64Binary.

It queries all URI mappers and resolvers with kind EntityData::SOME_CONTENT.

Parameters

uri as xs:string
the resource to fetch.

Returns

xs:base64Binary
the resource referred to by the given URI as streamble base64Binary.

content-binary#2

declare  %an:streamable function fetch:content-binary($uri as xs:string, $entity-kind as xs:string) as xs:base64Binary external

Tries to fetch the resource referred to by the given URI and returning it as base64Binary.

It queries all URI mappers and resolvers with kind the specified entity kind.

Parameters

uri as xs:string
the resource to fetch.
entity-kind as xs:string
the kind of resource to fetch.

Returns

xs:base64Binary
the resource referred to by the given URI as streamble base64Binary.

content#1

declare  %an:streamable function fetch:content($uri as xs:string) as xs:string

Tries to fetch the resource referred to by the given URI.

It queries all URI mappers and resolvers with kind EntityData::SOME_CONTENT.

The content is assumed to be UTF-8 encoded.

Parameters

uri as xs:string
the resource to fetch.

Returns

xs:string
the resource referred to by the given URI as streamble string.

content#2

declare  %an:streamable function fetch:content($uri as xs:string, $entity-kind as xs:string) as xs:string

Tries to fetch the resource referred to by the given URI.

It queries all URI mappers and resolvers with kind the specified entity kind.

The content is assumed to be UTF-8 encoded.

Parameters

uri as xs:string
the resource to fetch.
entity-kind as xs:string
the kind of resource to fetch.

Returns

xs:string
the resource referred to by the given URI as streamble string.

content#3

declare  %an:streamable function fetch:content($uri as xs:string, $entity-kind as xs:string, $encoding as xs:string) as xs:string external

Tries to fetch the resource referred to by the given URI.

It queries all URI mappers and resolvers with kind the specified entity kind.

Parameters

uri as xs:string
the resource to fetch.
entity-kind as xs:string
the kind of resource to fetch.
encoding as xs:string
the encoding of the content

Returns

xs:string
the resource referred to by the given URI as streamble string.