Transform Action in IBM DataPower
Transform Action:
- Transform Action is the XSLT handling action item, XSLT is the most powerful language used in IBM DataPower.
- Using this transform action can do multiple transformations using XSLT based on the XML requests.
It can be performed in the following ways:
- Transform binary option.
- Transform with a processing control file, if specified.
- Transform with embedded processing instructions, if available.
- Transform with an XSLT style sheet.
Using Transform with XSLT style sheet option:
- Let’s create a simple service to demonstrate its functionality
- Let’s create a simple XSLT that takes XML data and converts it into JSON response
- Upload the XSLT file to the Data Power local directory.
- Create processing policy and processing rule.
- Drag the transform action onto the rule.
- Double tap on the transform action.
- Give the path of the file that we stored in the local directory in local
- Directory in the transform file field.
- Click done and configure the remaining service as required.
- Use any testing tool to test the service.
Using a Transform binary action option:
- Drag the transform icon to the processing rule.
- Double-click the transform icon.
- Enter the message’s context in the input area to process.
- From the use document processing instructions list, select transform binary.
- Now click on done and apply.
Using transform with embedded processing instructions, if available option:
- Drag the transform icon to the processing rule.
- Double-click the transform icon.
- From the use document processing instructions list, select transform with embedded processing instructions, if available.
- Enter the message’s context in the Input area to process.
- In the transform file field, specify the location of the style sheet for the action
Now click done and apply the changes.
Using transform with a processing control file, if specified option:
- To the processing rule, drag the transform icon.
- Click the transform icon twice.
- To process, enter the message’s context in the input section.
- With the set of instructions for document processing, select transform with the processing control file, if it is available.
- Choose the input language from the input language section document.
- In the input descriptor box, indicate XSD if that is the input language. You can either specify a context variable or the URL of the schema file leads to a list of relevant ones.
- Choose XQuery or none in the Transform Language column.
- Indicate the location of the control file for the action when the transform language is XQuery.
- Pick up an XQuery file locally (Sampl-XQuery.xq)
- The prerequisites to handle the input are contained in this example XQuery file.
Click “done” to make the changes now.