Each function in Table 6.3 returns a string.
Function | Meaning | |
---|---|---|
concat(string, string, …) | Concatenates any number of string arguments. The following expression resolves to Buick Skylark. concat('Buick ', 'Sky', 'lark') | |
name(node set) | Returns the name of the first node in the node set. Given our main example, the following expression resolves to CarPolicy, which is the name of the first retrieved node name(/Insured/*) | |
normalize-space(string) | Removes leading and trailing spaces and removes all but one space when multiple white-space characters (carriage returns, spaces, tabs) are between other characters. The following expression resolves to Buick Skylark normalize-space(' Buick Skylark ') | |
substring(string, number, number) | Returns a substring of the first argument, starting at a specified position (the first number). The substring continues for a specified number of characters (the second number) or (if the second number is omitted) returns the rest of the string. Each of the following expressions resolves to Speed substring('Porsche Speedster', 9, 5) substring('Porsche Speed', 9) | |
substring-after(string, string) | Returns a substring of the first argument, starting at one position after the first occurrence of the second string. The following expression resolves to a space, then Speedster. substring-after('Porsche Speedster', 'e') | |
substring-before(string, string) | Returns a substring of the first argument, starting at the beginning of the first argument and ending at one position before the first occurrence of the second string. The following expression resolves to Porsche, then a space. substring-before('Porsche Speedster', 'S') | |
translate(string, string, string) | Returns a variant of the first argument:
The second and third arguments are a matching array of characters. If the third argument is longer than the second, the extra positions have no effect. If the third argument is shorter than the second, the missing position removes a character from the returned string. The second example in the next table shows a character removal. | |
Invocation | Returns | |
translate('98786', '8', 'X') | 9X7X6 | |
translate('98786', '87', 'X') | 9XX6 | |
translate('98786', '87', 'XPA') | 9XPX6 |