function "UCASE" { param "text"; value "translate($text, 'abcdefghijklmnopqrstuvwxyz-', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_')"; } function "lcase" { param "text"; value "translate($text, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ-', 'abcdefghijklmnopqrstuvwxyz_')"; } function "CamelCase" { param "text"; choose { when "contains($text, '-')" { const "tokens", "str:tokenize($text, '-')"; for "$tokens" { choose { when ".='pEp'" > pEp otherwise { call "UCASE" with "text", "substring(., 1, 1)"; call "lcase" with "text", "substring(., 2)"; } } } } otherwise | unsupported } }