The IATA_FlightInformationReport.mfd file available in the <Documents>\Altova\MapForce2020\MapForceExamples\ folder shows an example mapping of an IATA PADIS file to an XML target file.
This mapping consists of a source IATA component which includes a FLIRES message, a target XML component, and two user-defined functions, parseDateTime and airportcode2Names (which are reused multiple times).
To view the instance file read or written by the source or target components, as well as other settings, right-click the component, and select Properties (see also EDI Component Settings).
To view the structure of each user-defined function, double-click it. To go back to the main mapping, click the Return to Main Mapping ( ) button available in the upper-left corner of the mapping area. For more information, see User-Defined Functions.
In this mapping, the user-defined functions have the following purpose:
1) The parseDateTime function receives as arguments the date and time from IATA date and time elements and processes them in order to produce an xs:dateTime value required in the target XML file. To achieve this goal, it makes use of various functions available in the MapForce core library, such as
Structure of the parseDateTime function
2) The airportcode2Names function receives as argument the F3223 or F3224 field values (the airport code) and returns the full name of the airport. To achieve this, the function contains a Value-Map component which maps each airport code to an airport name, as follows:
Structure of the Value-Map component
For more information about Value-Map components, see Using Value-Maps.
On the target side, the XML component uses a technique called "duplication of nodes". Namely, the node Station is being duplicated multiple times on the mapping component. This makes it possible to map values from multiple source items to the same target item (see Duplicating Input).
To preview the output produced by the mapping, click the Output tab.