A RESTful browser for eXist Java-Based Function Modules


http://www.w3.org/2005/xpath-functions
A module with the XQuery/XPath Core Library Functions

translate($arg as xs:string?, $map as xs:string, $trans as xs:string) xs:string
Returns the value of $arg modified so that every character in the value of $arg that occurs at some position N in the value of $map has been replaced by the character that occurs at position N in the value of $trans.
If the value of $arg is the empty sequence, the zero-length string is returned.
Every character in the value of $arg that does not appear in the value of $map is unchanged.
Every character in the value of $arg that appears at some position M in the value of $map, where the value of $trans is less than M characters in length, is omitted from the returned value. If $map is the zero-length string $arg is returned.
If a character occurs more than once in $map, then the first occurrence determines the replacement character. If $trans is longer than $map, the excess characters are ignored.
i.e. fn:translate("bar","abc","ABC") returns "BAr"
$argThe string to be translated
$mapThe map string
$transThe translation string

Returns the translated string
Return to list of all modules