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

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

This module provides string related functions.

Author:

Matthias Brantner

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.1. For more information about module versioning in Zorba please check out this resource.

Module Resources
Namespaces
string http://www.zorba-xquery.com/modules/string
ver http://www.zorba-xquery.com/options/versioning
Function Summary
External is-streamable ( $s as xs:string ) as xs:boolean external
This function checks whether a given string item is implemented by a streamable string.
External materialize ( $s as xs:string ) as xs:string external
This function materializes a streamable string.
External split ( $s as xs:string, $separator as xs:string ) as xs:string* external
Returns a sequence of strings constructed by splitting the input wherever the given separator is found.
Functions
Streamable External is-streamable back to 'Function Summary'
declare function string:is-streamable (
            $s as xs:string 
 ) as xs:boolean external

This function checks whether a given string item is implemented by a streamable string. A streamable string is produced by some functions of a module (e.g. file:read-text()). It's an optimized implementation of an xs:string to handle arbitrary sized data. The drawback is that its value can only be consumed once. That is, only one function can access the value of a streamable string item.

Parameters:
Returns:

External materialize back to 'Function Summary'
declare function string:materialize (
            $s as xs:string 
 ) as xs:string external

This function materializes a streamable string. The drawback of a streamable string is that its value can only be consumed once. That is, only one function can access the value of a streamable string item. In order to remedy this situation, this function can be used to convert a streamable string into its non-streamable counterpart. As a result, the string returned by this function has the same value as its input but is materialized and, hence, can be consumed multiple times.

Parameters:
Returns:
See:

External split back to 'Function Summary'
declare function string:split (
            $s as xs:string, 
            $separator as xs:string 
 ) as xs:string* external

Returns a sequence of strings constructed by splitting the input wherever the given separator is found. The function is different from fn:tokenize. It doesn't allow the separator to be a regular expression. This restriction allows for more performant implementation. Specifically, the function processes streamable strings as input in a streamable way which is particularly useful to tokenize huge strings (e.g. if returned by the file module's read-text function).

Parameters:
Returns:

blog comments powered by Disqus