upper-case function
The fn:upper-case function converts a string to uppercase.
Syntax
- source-string
- The string that is to be converted to uppercase.
source-string has the xs:string data type, or is an empty sequence.
- locale-name
- A string containing the locale to be used for the uppercase operation.
locale-name is of type xs:string, or is the empty sequence. If locale-name is not the empty sequence, the value of locale-name is not case sensitive and must be a valid locale or a string of length zero.
Returned value
If source-string is not an empty sequence, the returned value is source-string with each character converted to its uppercase correspondent. If locale-name is not specified, is the empty sequence, or is a string of length zero, then the uppercase rules as defined in the Unicode standard are used. Otherwise, the uppercase rules for the specified locale are used. Every character that does not have an uppercase correspondent is included in the returned value in its original form.
If source-string is the empty sequence, the returned value is a string of length zero.
Examples
fn:upper-case('Test literal 1')
The returned value is 'TEST LITERAL 1'.
The following function specifies the Turkish locale tr_TR and converts the letter "i", and the numeric character reference ı (the character reference for Latin small letter dotless i).
fn:upper-case("iı", "tr_TR")
The returned value consists of two characters, the character represented by İ (Latin upper case I with dot above), and the letter "I". For the Turkish locale, the letter "i" is converted to character represented by İ (Latin upper case I with dot above), and character represented by ı (Latin small letter dotless i) is converted to the letter "I".
The following function does not specify a locale and converts two characters to uppercase using the rules defined in the Unicode standard.
fn:upper-case("ıi")
The function returns the characters "II". fn:upper-case converts both the lowercase character ı and the letter "i" to the uppercase letter "I".