Skip to Content
Technical Articles
Author's profile photo Kamlesh Zanje

Cloud Integration – XSLT Mapping is enriched with XSLT 3.0 specification

Introduction

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.

  1. 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.
  2. 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.
  3. 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.


    Conclusion

    We learnt about different capabilities of XLST 3.0 with examples from different scenariosSee you again with another blog on exciting new features from Cloud Integration!

    Looking forward to your questions, remarks and feedback.

Assigned tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Hilmar Falkenberg
      Hilmar Falkenberg

      Is it also possible to call java functions that are NOT part of the runtime? I know how to add jars to an IFlow and use the library inside goovy scripts. Are such library functions also available now?

       

      Author's profile photo Kamlesh Zanje
      Kamlesh Zanje
      Blog Post Author

      Hello Hilmar,

      Yes, such library function call should be possible from the XSLT resource.

      Regards,

      Kamlesh.

      Author's profile photo Vikas Singh Rajpurohit
      Vikas Singh Rajpurohit

      Thanks for the Great Blog Kamlesh.

      This was a long wait for me . This gives more power to xslt maps :).

       

      Author's profile photo Vikas Singh Rajpurohit
      Vikas Singh Rajpurohit

      Is creation of Headers and Properties via xslt is supported?

      Author's profile photo Aman Gupta
      Aman Gupta

      Yes, Vikas. It is possible.

      PFB the code.

       

      Author's profile photo Kamlesh Zanje
      Kamlesh Zanje
      Blog Post Author

      Hello Vikas,

      This capability is available with XSLT 1.0 as well.

      Regards,

      Kamlesh.

       

       

       

      Author's profile photo Vikas Singh Rajpurohit
      Vikas Singh Rajpurohit

      thanks