A RESTful browser for eXist Java-Based Function Modules


http://www.w3.org/2005/xpath-functions
A module with the XQuery/XPath Core Library Functions

starts-with($source as xs:string?, $prefix as xs:string?) xs:boolean?
Returns an xs:boolean indicating whether or not the value of $source starts with a sequence of collation units that provides a minimal match to the collation units of $prefix according to the collation that is used.
Note:
"Minimal match" is defined in [Unicode Collation Algorithm].
If the value of $source or $prefix is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
If the value of $prefix is the zero-length string, then the function returns true. If the value of $source is the zero-length string and the value of $prefix is not the zero-length string, then the function returns false.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error may be raised [err:FOCH0004].
$sourceThe source string
$prefixThe string to determine if is a prefix of $source

Returns true if $prefix is a prefix of the string $source

starts-with($source as xs:string?, $prefix as xs:string?, $collation-uri as xs:string) xs:boolean?
Returns an xs:boolean indicating whether or not the value of $source starts with a sequence of collation units that provides a minimal match to the collation units of $prefix according to the collation that is used.
Note:
"Minimal match" is defined in [Unicode Collation Algorithm].
If the value of $source or $prefix is the empty sequence, or contains only ignorable collation units, it is interpreted as the zero-length string.
If the value of $prefix is the zero-length string, then the function returns true. If the value of $source is the zero-length string and the value of $prefix is not the zero-length string, then the function returns false.
The collation used by the invocation of this function is determined according to the rules in 7.3.1 Collations. If the specified collation does not support collation units an error may be raised [err:FOCH0004]. The third argument $collation-uri is relative so you only need to specify the last part of a valid full collation-uri, e.g. '?lang=sv-SE', 'lang=sv-SE;strength=primary;decomposition=standard' or 'swedish'.
$sourceThe source string
$prefixThe string to determine if is a prefix of $source
$collation-uriThe collation URI

Returns true if $prefix is a prefix of the string $source
Return to list of all modules