20 Transformation Type

This topic provides the information about the transformation types.

Velocity

Velocity is a Java-based template engine. It is used to generate XML files, SQL, PostScript, and most other text-based formats.

Note:

In Routing Hub, velocity is used to generate JSON and XML files.
  • Using $body, user can access request/response body.

    Syntax: $body.fieldName

    Example: $body.branchCode

  • Using $headers, user can access request/response headers.

    Syntax: $headers["fieldName"][0]

    Example: $headers["branchCode"][0]

  • Using $bodyAsString, user can access response body as string.

    Syntax: $bodyAsString

  • Below are some available extension methods:
  • If issue occurred with hyphen in velocity template of Request or Response Transformation, then use get method.

    Example:

    <FCUBS_BODY>
       <Customer-IO>
         <CUSTNO>003942</CUSTNO>
       </Customer-IO>
    </FCUBS_BODY>

    If $in.FCUBS_BODY.Customer-IO.CUSTNO does not work , use $in.FCUBS_BODY.get("Customer-IO").CUSTNO to get customer number.

XSLT

XSLT is a language for transforming XML documents into other XML documents, or other formats such as HTML for web pages, plain text or XSL formatting objects, which may subsequently be converted to other formats, such as PDF, PostScript and PNG.

Note:

In Routing Hub, XSLT is used to transform arbitrary XML to JSON.

JSLT

JSLT is a complete query and transformation language for JSON.