Converting Decimal Number to Hexadecimal Number in Data Mapping

Requirement:

To convert the Decimal numbers (viz. 999.50) to the Hexadecimal Number (3E7.5) in the output.

Approach:

The above requirement can be easily achieved by creating the XSL Template in data mapping & then this XSL Template can be used on the target element whenever required.

XSL template - It is a customized template and used to define the functions which need to be used repeatedly to perform a set of functions.

For example, if you need to perform the addition of two numbers at regular intervals, you can define the addition function in an XSL template & then call this XSL template whenever required. 

Once the XSL template is added it can be used in the Data Mapping to map the elements. You can also define the scope of an XSL template while creating and saving it. An XSL template can be defined in three scope levels - Local, Global, Group. Refer to XSL documentation for more information.

Steps to Create XSL Template:

  1. Click XSL Template option displayed next to mapping functions on the Mapping Functions Panel.
  2. Select Manage XSL Template option or click the Manage XSL Template  icon in the toolbar

  3. Enter the name of the XSL template "ConvertDecToHex" in the Name field. This displays the XSL tags in the XSL Template area.
  4. Select the scope of the XSL Template as required. The default scope of an XSL Template is Local.

  5. Click the Add  button to add parameters for the new XSL template.
  6. Enter the name of the parameter "index" in the Name field.
  7. Enter the attached code for the function "ConvertDecToHex" in the XSL Template field for the XSL Rules.

Once the XSL Template is created, call "ConvertDecToHex" XSL Template at the target element as shown below:

CALL TEMPLATE NAME="ConvertDecToHex" index~1="$Input_SourceXPath"
Have more questions? Submit a request

0 Comments

Article is closed for comments.