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.
Function name | Description |
---|---|
fn.analyzeString | 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.codepointEqual | Returns true if the specified parameters are the same Unicode code point, otherwise returns false. |
fn.codepointsToString | 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.encodeForUri | Invertible function that escapes characters required to be escaped inside path segments of URIs. |
fn.endsWith | Returns true if the first parameter ends with the string from the second parameter, otherwise returns false. |
fn.escapeHtmlUri | %-escapes everything except printable ASCII characters. |
fn.iriToUri | Idempotent function that escapes non-URI characters. |
fn.lowerCase | 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.normalizeSpace | 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.normalizeUnicode | 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.startsWith | Returns true if the first parameter starts with the string from the second parameter, otherwise returns false. |
fn.stringJoin | Returns an xs:string created by concatenating the members of the $parameter1 sequence using $parameter2 as a separator. |
fn.stringLength | Returns an integer representing the length of the specified string. |
fn.stringToCodepoints | 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.substringAfter | Returns the substring created by taking all of the input characters that occur after the specified $after characters. |
fn.substringBefore | 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 constructed 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.upperCase | Returns the specified string converting all of the characters to upper-case characters. |
sql.glob | Returns true if the specified $input glob the specified $pattern, otherwise returns false. |
sql.like | Returns true if the specified $input like the specified $pattern, otherwise returns false. |