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-string The 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-equal Returns true if the specified parameters are the same Unicode code point, otherwise returns false.
fn:codepoints-to-string Creates an xs:string from a sequence of Unicode code points.
fn:compare Returns -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:concat Returns the xs:string that is the concatenation of the values of the specified parameters.
fn:contains Returns true if the first parameter contains the string from the second parameter, otherwise returns false.
fn:encode-for-uri Invertible function that escapes characters required to be escaped inside path segments of URIs.
fn:ends-with Returns 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-uri This 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-uri Idempotent function that escapes non-URI characters.
fn:lower-case Returns the specified string converting all of the characters to lower-case characters.
fn:matches Returns true if the specified $input matches the specified $pattern, otherwise returns false.
fn:normalize-space Returns 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-unicode Return the argument normalized according to the normalization criteria for a normalization form identified by the value of $normalizationForm.
fn:replace Returns a string constructed by replacing the specified $pattern on the $input string with the specified $replacement string.
fn:starts-with Returns true if the first parameter starts with the string from the second parameter, otherwise returns false.
fn:string-join Returns an xs:string created by concatenating the members of the $parameter1 sequence using $parameter2 as a separator.
fn:string-length Returns 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-codepoints Returns the sequence of Unicode code points that constitute an xs:string.
fn:substring Returns a substring starting from the $startingLoc and continuing for $length characters.
fn:substring-after Returns the substring created by taking all of the input characters that occur after the specified $after characters.
fn:substring-before Returns the substring created by taking all of the input characters that occur before the specified $before characters.
fn:tokenize Returns a sequence of strings contructed by breaking the specified input into substrings separated by the specified $pattern.
fn:translate Returns 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-case Returns the specified string converting all of the characters to upper-case characters.