%@ page language="C#" masterpagefile="~/templates/Master1.master" inherits="Page"
keywords="XML to EDI, translate XML to EDI, translating XML to EDI,
convert XML to EDI, converting XML to EDI, XML to EDI bridge, EDI bridge,
XML to EDIFACT, translate XML to EDIFACT, translating XML to EDIFACT,
convert XML to EDIFACT, converting XML to EDIFACT, XML to EDIFACT bridge, EDIFACT bridge" %>
Once an XML document is created that contains the proper content to
fill an EDIFACT structure, the adapter will do the syntactical translating
for you. But how do you get the XML data to look right? Using the same steps as in
Converting EDIFACT to XML,
we're going to load an EDIFACT document into the editor, change it, and save it
back out — and we'll watch the change occur. This will demonstrate an XML document
turning back into EDIFACT. Then we'll see how we can do this automatically as part of an
XSLT transformation. Here are the steps for this demonstration: Perform the following steps: Let's change the recipient from DATADIRECT to SAXONICA. Before: After: Do Comparing the two files shows that you just changed an EDIFACT document without an
EDIFACT editor, or even seeing the EDIFACT file itself!Translating XML documents to EDIFACT
Open the EDIFACT document in the XML editor
Change XML EDIFACT
<UNB03>
<UNB0301><!--0010: Interchange recipient identification-->DATADIRECT</UNB0301>
<UNB0302><!--0007: Identification code qualifier-->1<!--DUNS (Data Universal Numbering System)--></UNB0302>
</UNB03>
<UNB03>
<UNB0301><!--0010: Interchange recipient identification-->SAXONICA</UNB0301>
<UNB0302><!--0007: Identification code qualifier-->1<!--DUNS (Data Universal Numbering System)--></UNB0302>
</UNB03>
Save XML document in EDIFACT format
File|Save As and choose a new filename; make sure that the
"Convert from XML using adapter" checkbox is checked and keep the same EDI
adapter chosen.See changed EDIFACT

We could automate this, and take the input document, change it with XSLT or XQuery, and save it as a new EDIFACT document with our change. Here are the steps:
edifact-change.xsl belowafter.edi, also passing through the EDI adapterWhat this does is the same thing we just did, but mechanically. It finds the UNB0301 segment and replaces whatever content text was there with the string SAXONICA. It also filters out any comments (but we could pass them along by replacing the line
The EDIFACT can be generated completely from XSLTor XQuery, and schemas can be generated against which to map and validate your EDIFACT XML.
The adapters can be used in other contexts as well. They may be built right in to your own applications, using either the data conversion API or as part of your file handling or XSLT/XQuery processing through the deployment adapters.
Simplify working with Electronic Data Interchange (EDI) with <%= ConfigurationManager.AppSettings["SS"] %>'s award-winning EDI Tools — Download a free trial of our today!
Simplify your next legacy data integration project with the help of the EDIFACT Zone, the world's largest, free online reference covering all EDIFACT and UN/CEFACT versions.