Appendix J.2 Format transformation methods
(1) Data settings at transformation source and transformation destination
To transform the formats of the data acquired using the database adapter, use the data transformation definition.
In the Data Transformation Definition screen, set up the data acquired using the database adapter in the transformation source schema tree viewer and the XML schema with the post-transformation format in the transformation destination schema tree viewer.
![[Figure]](figure/zs0h0050.gif)
(2) Acquiring the cid attribute value of the column name
In the DBA_ResultSetName element of the response message, the column name and the ID (cid attribute) are stored in pairs. Use the trim node function to acquire the cid attribute corresponding to the column name specified in the node conditions.
To acquire the cid attribute value of the column name:
- Define the trim node function for the cid attribute under the DBA_ResultColumnName element.
For details about how to define the trim node function, see 6.5.5 Removing Spaces from a String.
![[Figure]](figure/zs0h0100.gif)
- In the Trim Node dialog box, click the Set Node Conditions button.
The Set Node Conditions dialog box appears.
- In the Set Node Conditions dialog box, click the Set Conditions button.
The Set Conditions dialog box appears.
- Set up the node conditions.
Specify the settings as follows:
- Left-hand side: DBA_ResultColumnName element
- Right-hand side: Column name (here, Order_number)
![[Figure]](figure/zs0h0200.gif)
- Similarly define the elements for the Customer_code, Product_code, and the Number_of_orders.
![[Figure]](figure/zs0h0300.gif)
(3) Settings for the loop node function
Map the loop node function from the DBA_ResultSet element of the transformation source to the record element of the transformation destination. For details about how to define the loop node function, see 6.5.16 Mapping Looping.
![[Figure]](figure/zs0h0400.gif)
(4) Assigning the values to the column name element at the transformation destination
Assign a value to each row name element at the transformation destination. In this case, set up the conditions such that the trim node function defined in (2) Acquiring the cid attribute value of the column name matches the cid attribute under the DBA_ResultColumn element.
To assign a value to each row name element of the transformation destination:
- Right click the transformation destination element (here, Order_number) and choose Mapping Source.
The Set Mapping Source dialog box appears.
![[Figure]](figure/zs0h0500.gif)
- In the Mapping Source, select DBA_ResultColumn.
![[Figure]](figure/zs0h0600.gif)
- In the Set Mapping Source dialog box, click the Set Node Conditions button.
The Set Node Conditions dialog box appears.
- In the Set Node Conditions dialog box, click the Set Conditions button.
The Set Conditions dialog box appears.
- Set up the node conditions.
Specify the settings as follows:
- Left-hand side: cid attribute under the DBA_ResultColumn element
- Right-hand side: Trim node function defined to correspond to the transformation destination column name
![[Figure]](figure/zs0h0700.gif)
- Similarly define the elements for the Customer_code, Product_code, and the Number_of_orders.
![[Figure]](figure/zs0h0800.gif)
(5) Validating the defined contents
Validate whether the defined mapping is consistent. For details about the validation method, see 5.10.2 Validation Method.