Version:

fn functions (String)

The string built-in functions are XQuery functions defined to operate on string values. They are defined in XQuery 1.0 and XPath 2.0 Functions and Operators.

The string built-in functions use the fn namespace prefix, which is predefined in the server. Also, the fn prefix is the default prefix for function calls if none is specified.

27 functions
Function nameDescription
fn:analyze-stringThe result of the function is a new element node whose string value is the original string, but which contains markup to show which parts of the input match the regular expression.
fn:codepoint-equalReturns true if the specified parameters are the same Unicode code point, otherwise returns false.
fn:codepoints-to-stringCreates an xs:string from a sequence of Unicode code points.
fn:compareReturns -1, 0, or 1, depending on whether the value of the $comparand1 is respectively less than, equal to, or greater than the value of $comparand2, according to the rules of the collation that is used.
fn:concatReturns the xs:string that is the concatenation of the values of the specified parameters.
fn:containsReturns true if the first parameter contains the string from the second parameter, otherwise returns false.
fn:encode-for-uriInvertible function that escapes characters required to be escaped inside path segments of URIs.
fn:ends-withReturns true if the first parameter ends with the string from the second parameter, otherwise returns false.
fn:escape-html-uri%-escapes everything except printable ASCII characters.
fn:escape-uriThis is a May 2003 function, and is only available in compatibility mode (XQuery 0.9-ML)--it has been replaced with fn:encode-for-uri, fn:iri-to-uri, and fn:escape-html-uri.
fn:iri-to-uriIdempotent function that escapes non-URI characters.
fn:lower-caseReturns the specified string converting all of the characters to lower-case characters.
fn:matchesReturns true if the specified $input matches the specified $pattern, otherwise returns false.
fn:normalize-spaceReturns the specified string with normalized whitespace, which strips off any leading or trailing whitespace and replaces any other sequences of more than one whitespace characters with a single space character (#x20).
fn:normalize-unicodeReturn the argument normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm.
fn:replaceReturns a string constructed by replacing the specified $pattern on the $input string with the specified $replacement string.
fn:starts-withReturns true if the first parameter starts with the string from the second parameter, otherwise returns false.
fn:string-joinReturns an xs:string created by concatenating the members of the $parameter1 sequence using $parameter2 as a separator.
fn:string-lengthReturns an integer representing the length of the specified string.
fn:string-pad[0.9-ml only] Returns a string representing the $padString concatenated with itself the number of times specifed in $padCount.
fn:string-to-codepointsReturns the sequence of Unicode code points that constitute an xs:string.
fn:substringReturns a substring starting from the $startingLoc and continuing for $length characters.
fn:substring-afterReturns the substring created by taking all of the input characters that occur after the specified $after characters.
fn:substring-beforeReturns the substring created by taking all of the input characters that occur before the specified $before characters.
fn:tokenizeReturns a sequence of strings contructed by breaking the specified input into substrings separated by the specified $pattern.
fn:translateReturns a string where every character in $src that occurs in some position in the $mapString is translated into the $transString character in the corresponding location of the $mapString character.
fn:upper-caseReturns the specified string converting all of the characters to upper-case characters.