 |
 |
 | Altova MapForce offers extensive built-in support for prevalent EDI data formats, including UN/EDIFACT, ANSI X12, and Health Level 7 (HL7), as the source and/or target of any data mapping. When you don’t have a specific XML Schema to map to and simply need to get your EDI data into an XML format, you can utilize the library of configuration files for the EDIFACT EDI dialect that ship with MapForce to generate an XML Schema in XMLSpy. Then you can use this schema in MapForce for the EDI to XML transformation. Because of the high volume of EDIFACT messages, we will concentrate on the ORDERS message only for this example, but the process can be repeated for the remaining files. - 1. First, download the XSLT stylesheets provided here. (3 KB)
- 2. In MapForce, use the Insert > EDI command to select ORDERS message configuration file as the source structure for the mapping.
 - You will be prompted to include a sample EDI file to preview the transformation.
- 3. Now we need to generate the XML Schema that we will use as the target structure in our mapping. Open MESSAGEConversion.xsl in XMLSpy and run an XSL transformation on ORDERS.config, which you can find at C:\Program Files\Altova\MapForce2008\MapForceEDI\EDIFACT\ORDERS.Config. This operation will generate an XSD file. You will receive an empty HTML output if you have not changed the default settings of XMLSpy, so click on the Text or Schema/WSDL tab to see the output.
*Please note: You will receive a validation warning until you complete step 4 below. - 4. Save the XSD as ORDERS.xsd (or a name of your choosing) in a directory to be used for storing your XML Schema files (all of your generated XSD files will need to be in the same directory).
- 5. Repeat the XSL transformation process in steps 3 and 4 with SEGMENTConversion.xsl using EDI configuration files Admin.Segment and EDSD.Segment as input. Save the resulting output as Admin.xsd and EDSD.xsd, respectively.
- 6. Go back to MapForce and insert the XSD as the target structure in the MapForce mapping using the Insert > XMLSchema/File… command. When prompted, select Envelope as the root element.
 - 7. Now, simply drag a connecting line from the Envelope element in the EDI source to the Envelope element in the XSD target. MapForce will automatically connect the child elements to complete the one-to-one mapping to convert your data from EDIFACT to XML.
 - 8. Click the Output tab to execute the mapping, and MapForce will automatically generate a valid XML file containing all of the EDIFACT data.
Click here to download a fully functional, free 30-day trial of Altova MapForce® 2010!
|
 |
 |
 |