Generating XML from EDI
As mentioned previously, you can map EDI data to or from any of the other data formats supported by MapForce. EDI mappings are not significantly different from non-EDI mappings, and involve the same level of control over the generated data.
Beyond regular mappings that require some design effort, MapForce also provides the ability to quickly convert EDI files to XML format, with a few button clicks—this does not require writing any XML schema or drawing mapping connections manually. This is a convenience feature that enables you to export EDI files to an alternative format—which is significantly easier to read. The XML output is well-formed and can be saved to a file, like most outputs generated by MapForce.
Making use of this feature neither requires nor provides an XML schema. The generated XML simply replicates all the data from the source EDI component, outputting the data element names and their values, and respecting the hierarchy of elements. Any fields that do not contain data are omitted. Note that the exact structure of the generated XML depends on the source EDI data and cannot be altered. If you need full control over the generated XML data, create a standard EDI to XML mapping instead, which would enable you to tackle each individual mapping item, use filters, functions, and so on. For examples of standard EDI to XML mappings, see Example: Mapping UN/EDIFACT to XML, Example: Mapping HIPAA X12 to XML, and Example: Mapping HL7 to XML.
To quick convert EDI files to XML with MapForce, the transformation language of the mapping must be set to BUILT-IN; no other transformation languages are supported. This requirement specifically applies to quick EDI to XML conversion. Regular EDI to XML mappings support additional languages, see EDI.
Quick EDI to XML conversion
After you have added an EDI component to the mapping, there are two ways to generate XML from it:
1.If the EDI component reads data from an EDI instance file (in other words, if it is a source component), right-click its title bar and select Creating Mapping to XML from the context menu. For a step-by-step example, see Example: Quick Convert EDI to XML.
|Note:||You can also do this for target components, if you would like to create a new output in addition to the existing EDI output, and thus turn the mapping into a "chained" mapping. For more information, see Chained Mappings.|
2.If the EDI component is a target one, first double-click its title bar to open the component's settings, and then select the Write content in XML format check box. For a step-by-step example, see Example: Switch between XML and EDI Output.