SAP Cloud Integration offers capabilities through XSLT Mapping to transform XML documents into other documents such as XML, HTML or text. XSLT Mapping leverages XSLT 1.0 specification to perform this transformation.
With April 2019 release (v2.52.x/v3.10.x), the transformation capability in the XSLT Mapping step (version 1.2) has been enhanced by leveraging the XSLT 3.0 specification. This release is planned to reach customers around 14th April 2019. The XSLT Mapping usage has been described in the SAP Help Portal (see XSLT Mapping 1.2)
In this blog, I would describe the distinctive capabilities of XSLT 3.0 that can be leveraged through XSLT Mapping. For detailed understanding on XSLT 3.0 capabilities, please refer to this link – What’s new in XSLT 3.0.
The distinctive changes that you will notice in the Integration flow tooling.
- Drag and drop the XSLT Mapping flow step from the palette in the integration flow. The version of the flow step will now be 1.2.
- You will also notice that the XSLT resource version would be 3.0 in the xsl stylesheet.
Let’s have a look at some of the capabilities of XSLT 3.0.
- Convert JSON to XML using XSLT 3.0 function.This scenario explains how to convert JSON into XML using XSLT 3.0 function in XSLT Mapping step.Sample JSON payload.XSLT resource which makes use of funtion:json-to-xml() The output can be viewed in the Message processing monitor You can refer to this link – json-to-xml for more detailed understanding.
- Two new data structures, maps and arrays, have been added to the data model. Make sure you declare the namespaces to use these data structures in the XSLT. This scenario explains how to construct maps and arrays in the XSLT resource of the XSLT Mapping flow step. The below example tells you how to construct maps.The output of the processing can be viewed in the Message processing monitor.You can refer to this links – map, array for more understanding.
- Major focus for enhancements in XSLT 3.0 is the requirement to enable streaming of source documents.This is needed:
- When source documents become too large to hold in main memory
- For applications where it is important to start delivering the results before the entire source document is available.Set the value for streamable mode to “yes” to enable the streaming of source document. More details can be found in this link – streaming
- One of the most salient features in XSLT Mapping step version 1.2 is that it allows invocation of the Java function call from the XSLT resource.The below java function call will display the current date and time. The output of the processing can be viewed in the Message processing monitor. More details in this link – java function call.
We learnt about different capabilities of XLST 3.0 with examples from different scenarios. See you again with another blog on exciting new features from Cloud Integration!
Looking forward to your questions, remarks and feedback.