- All Modules
- All Functions
-
www.w3.org
- 2005
- XDM
- store
- introspection
- reflection
- external
-
xqdoc
-
xqdoc
(E)
-
project_xqdoc
- xqdoc2xhtml
-
xqdoc
(E)
- data processing
- expath.org
- www.functx.com
- debugger
- error
- jsoniq.org
- www.zorba-xquery.com
http://www.zorba-xquery.com/modules/string
import module namespace string = "http://www.zorba-xquery.com/modules/string";
This module provides string related functions.
Matthias Brantner
xquery version "1.0" encoding "utf-8";
The latest version of this module is 2.1. For more information about module versioning in Zorba please check out this resource.
- the XQuery module can be found here.
string | http://www.zorba-xquery.com/modules/string |
ver | http://www.zorba-xquery.com/options/versioning |
![]() |
is-streamable
(
$s as xs:string
) as xs:boolean This function checks whether a given string item is implemented by a streamable string. |
![]() |
materialize
(
$s as xs:string
) as xs:string This function materializes a streamable string. |
![]() |
split
(
$s as xs:string,
$separator as xs:string
) as xs:string* Returns a sequence of strings constructed by splitting the input wherever the given separator is found. |
declare function string:is-streamable ( $s as xs:string ) as xs:boolean
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.
- $s the string to check
- true if the given item is implemented using a streamable string or false otherwise.
declare function string:materialize ( $s as xs:string ) as xs:string
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.
- $s the streamable string item to materialize
- a materialized string of its input or the input if the input item was not a streamable string.
declare function string:split ( $s as xs:string, $separator as xs:string ) as xs:string*
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).
- $s the input string to split
- $separator the separator used for splitting the input string $s
- a sequence of strings constructed by splitting the input