How to convert a string to upper case or lower case in CA APIM Gateway

Document ID : KB000112266
Last Modified Date : 28/08/2018
Show Technical Document Details
Introduction:
CA API Gateway doesn't have string processing assertions.
But gateway has xpath assertion supports xpath functions which can be used to convert a string to upper case or lower case.
Instructions:
The gateway 9.3 supports xpath 2.0, but the gateway in old version may only support xpath 1.0. 
  • Function for both xpath 1.0 and xpath 2.0:
translate(string1,string2,string3) -- Converts string1 by replacing the characters in string2 with the characters in string3

xpath expression example for upper case:
translate($request.mainpart,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')
  • Functions for xpath 2.0:
  1. upper-case(string) -- Converts the string argument to upper-case
  2. lower-case(string) -- Converts the string argument to lower-case
xpath expression example for lower case:
lower-case($orgstr)
 
The sample policies will be attached.
Additional Information:
https://www.w3schools.com/xml/xsl_functions.asp
File Attachments:
case convert sample policies.zip