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

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

book

Article ID: 112266

calendar_today

Updated On:

Products

STARTER PACK-7 CA Rapid App Security CA API Gateway

Issue/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.

Environment

Release:
Component: APIGTW

Resolution

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

Attachments

1558536727295case_convert_sample_policies.zip get_app