Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Apart from the example below, there is a separate page with the most common solutions: XSLT transformation examplesuse cases

EXAMPLE:

Let’s take as an example Interface for Sales Order creation. For some reasons, the structure of the payload message was changed:

...

PROCEDURE:

In our case, we need to apply the XSLT mapping to the input message. As mentioned previously, this can be achieved by transformation settings for Automation Object.

  1. Prepare the XSLT mapping for a message. Create a test case with type

...

  1. XSLT Transformation and copy your prepared message mapping to the content of the test case. Our example transformation:

    Image Modified

    Save the content and the test case.

  2. Open Automation Object configuration

...

  1. and go to XSLT section
    There are four parameters for XSLT transformation:

...

Parameter Name

...

Description

...

XSLT_INPUT

...

Execute XSLT on input payload

...

XSLT_INP2

...

Execute XSLT on input payload after variable processing and replacement

...

XSLT_OUT

...

Execute XSLT on reference output payload

...

XSLT_OUTC

...

Execute XSLT on output payload from current test case execution

...


Choose parameters based on your requirements (you can use all of them at the same time). In our example, we are using Execute XSLT _INPUT on input payload as we need to apply a transformation to the input payloadIt is also possible to run multiple XSLT transformations at a single stage (e.g., XSLT_INPUT). To achieve this, maintain multiple additional parameters with the same Parameter name and different values in the Group column. Value in the Group column will be used to sort the transformations and run them in a particular order.

  1. In the Parameter Value column, enter the test case that stores XSLT transformation (the test case created in step 1.). Save the configuration.

Let’s execute our main test case once again (with XSLT transformation).

...

Using appropriate XSLT mapping, you can solve many issues with differences between XML structures in input/output payloads.

Info

Variables & Variable processing can be used in the XSLT. Define <xsl:param> with name equal variable name and you can use this variable in the XSLT code. For example:

<xsl:param name=”variable_name”>