EDIFACT and XML: A How-to Conversion Guide


The United Nations rules for Elec­tronic Data Interchange for Administration, Commerce and Transport, or EDIFACT, can impact how your company manages electronic data. Fortunately, XML files can be transformed to EDIFACT and vice versa quickly and without the need for deep programming experience. The process can be completely automated, as well, to eliminate unnecessary tasks. This blog will explain how to go from XML to EDIFACT files, as well as two methods to accomplish the reverse.

Compleo Hybrid allows the conversion of an XML file to EDIFACT, using an XML INVOICE, by following the steps below:

Part 1 : From EDIFACT to XML (Method #1)

Step 1. XML to PDF (Compleo Designer)

Compleo Designer uses the XML structure to fill the final template in EDIFACT format, creating the EDIFACT structure with the correct fields. Some lines are unique, but others must be repeated (example, item) therefore data tables are used.

The data is remapped to the corresponding line with logical conditions that ensure the collection of what is needed following the EDIFACT format, allowing the generation of the PDF file.

Step 2. PDF to TXT (Compleo Explorer)

In this step, the pdf file is read by Compleo Explorer.

It is required to count the lines of the EDIFACT document. The total number of lines of the document is requested in the last line of the EDIFACT format.

Compleo Explorer is also used to easily convert the previously obtained PDF file to a text file (.txt).

Final Step

The obtained text file (.txt) can be saved on a network path, sent by email, or communicated by REST API.

Part 2 : From EDIFACT to XML (Method #2)

Step 1. Save the file as a CSV file (Compleo Supervisor)
Step 2. Convert EDIFACT to XML (Compleo for XML)

Compleo for XML separates each column of data to manage the information in an organized way. The symbol “+” is used as the separator to delimitate columns.

Then, the XML structure tree is configured based on existing XML output samples.

Finally, data is matched to the elements with logical conditions to ensure that only the data needed is extracted where it corresponds.

Final step or result

About Compleo Hybrid

Compleo Hybrid is composed of multiple modules and secured services ready to be used and adaptable to the changes and needs of the industry. For example, thanks to Compleo for XML, EDIFACT files can be easily converted to XML while Compleo Supervisor automates the whole process. Furthermore, Compleo Designer allows the repetition of lines and conversion of XML format to PDF with EDIFACT conditions. Finally, Compleo Explorer enables the identification of the number of lines, the addition of that number to EDIFACT, and the conversion of the file to a text (.txt) format.

For more information, please contact us today and schedule your free consultation.