Functions: String 
Functions with “*” are extended functions for the Electronic File Manager: Format Definition add-on.
Parameters suffixed with a question mark “?” have a default value and can be omitted.
Description: Returns the number of characters in the string.
Sample:
string-length("abcd") returns 4
Description: Returns the local part of the expanded name of the node in the node-set argument that is first in the document order.
Sample:
<?xml version = 1.0”?>
<Text>
<Persons>
<Person>A</Person>
<Person>B</Person>
<Person>C</Person>
</Persons>
</Text>
If the context node is Person A, local-name() would be “Person”.
Description: Returns the namespace Uniform Resource Identifier (URI) of the expanded name of the node in the node-set argument that is first in the document order.
Sample:
<?xml version = 1.0”?>
<T: Text xmlns: T=x-schema:Text.xml”>
<Text>
<Persons>
<Person>A</Person>
<Person>B</Person>
<Person>C</Person>
</Persons>
</Text>
namespace-uri() would be “x-schema:Test.xml”.
Description: Returns a string containing a QName representing the expanded name of the node in the node-set argument that is first in the document order.
Sample:
<?xml version = 1.0”?>
<Text>
<Persons>
<Person>A</Person>
<Person>B</Person>
<Person>C</Person>
</Persons>
</Text>
If the context node is Person A, name() would be “Person”.
Description: Returns the string value of the argument, which could be a number, boolean, or node-set.
Sample:
string(314) returns “314”
Description: Returns the concatenation of the strings.
Sample:
concat('XPath','is','FUN!') Result: 'XPath is FUN!'
Description: Returns true if the first argument string starts with the second argument string; otherwise returns false.
Sample:
starts-with('XML','X') Result: true
Description: Checks whether the first argument string contains the second argument string.
Sample:
contains('XML','XM') Result: true
Description: Returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.
Sample:
substring-before("1999/04/01","/") returns “1999”.
Description: Returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string.
Sample:
substring-after("1999/04/01","/") returns “04/01”.
Description: Returns the substring of the first argument starting at the position specified in the second argument and having the length specified in the third argument. Index begins from 1.
Sample:
substring("12345",2,3) returns “234”
substring("12345",2) returns “2345”
Description: Returns the argument string with the leading, trailing, and repeating white spaces stripped.
Sample:
normalize-space(" abc def ") returns “abc def”
Description: Returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string.
Sample:
translate("bar","abc","ABC") returns “BAr”
Description: Returns a string that replaces argument 2 with argument 3 in argument 1.
Sample:
replace("hello", "h", "H") = “Hello”
Description: Returns a string filled with argument 2 and with length as argument 1. Sample: padding(10, “abc”) = “abcabcabca”
Description: Returns a string that aligns argument 1 within argument 2.
Sample: align(“abc”, ‘dddd’, true) = “abcd”
Description: Padding the target string with the specified padding character and also aligning and truncating as specified. Default value of allowTruncate is true.
Sample:
padding-align("hello", 10, "a", true, true) = “helloaaaaa”
Description: Returns the node set that is separated by unit length.
Sample:split-by-length('abcdefg', 3) returns {'abc', 'def', 'g'}
Description: Returns the node set that is separated by a separator.
Sample:
split('a, b, c', ',') returns {'a', 'b', 'c'}
Description: Reports the index of the first occurrence of a String. Index begins at 1. If not found, returns 0.
Sample:
find('ab cd', ' ') returns 3 find('ab cd ef', ' ', 4) returns 6
Description: Returns the first length chars in input.
Sample:
left('abcdefg', 5) returns 'abcde'
Description: Returns the last length chars in input.
Sample:
right('abcdefg',3) returns 'efg'
Description: Repeats an input several times.
Sample:
repeat('+',10) returns '++++++++++'
Description: Returns a string that is lowercase.
Sample:
lower('abC') returns 'abc'
Description: Returns a string that is uppercase.
Sample:
upper('ABc') returns 'ABC'
Description: Finds the position of the sub-string matching the pattern. Index begins at 1. If not found, returns 0
Sample:
regex-find(“hello2345”, “\d+”, 1) = 6
Description: Returns true if input matches the regex pattern
Sample:
regex-match(“2345”, “\d+”, 1) returns true
Description: Replaces all the matches in the input with a replacement string
Sample:
regex-replace(“hello 2345”, “\d+”, “sunshine”) = “hello sunshine”
Description: Returns the node set that is generated by a separator pattern.
Sample:
regex-split('a, b, c','[, ]') returns {'a', 'b', 'c'}
Description: Replaces the format item in a specified string with the text equivalent of the value of a specified object instance.
Sample:
format(“My name is {0}”, “Ray”) = “My name is Ray”