Jump to content

XML/EDIFACT

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 156.214.116.207 (talk) at 10:14, 26 July 2022 (Example 1: EDIFACT source code). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

XML/EDIFACT is an Electronic Data Interchange (EDI) format used in Business-to-business transactions. It allows EDIFACT message types to be used by XML systems.

EDIFACT is a formal machine-readable description of electronic business documents. It uses a syntax close to delimiter separated files. This syntax was invented in the 1980s to keep files as small as possible. Because of the Internet boom around 2000, XML started to become the most widely supported file syntax. But for example, an invoice is still an invoice, containing information about buyer, seller, product, due amount. EDIFACT works perfectly from the content viewpoint, but many software systems struggle to handle its syntax. So combining EDIFACT vocabulary and grammar with XML syntax makes XML/EDIFACT.

The rules for XML/EDIFACT are defined by ISO TS 20625.

Use-cases

XML/EDIFACT is used in B2B scenarios as listed below:

  1. Newer EAI or B2B systems often cannot handle EDI (Electronic Data Interchange) syntax directly. Simple syntax converters do a 1:1 conversion before. Their input is an EDIFACT transaction file, their output an XML/EDIFACT instance file.
  2. XML/EDIFACT keeps XML B2B transactions relatively small. XML element names derived from EDIFACT tags are much shorter and more formal than those derived from natural language since they are simply expressions of the EDIFACT syntax.
  3. A company does not want to invest into new vocabularies from scratch. XML/EDIFACT reuses business content defined in UN/EDIFACT. Since 1987, the UN/EDIFACT library was enriched by global business needs for all sectors of industry, transport and public services.
  4. Large companies can order goods from small companies via XML/EDIFACT. The small companies use XSLT stylesheets to browse the message content in human readable forms, as shown in Example 3.

Example 1: EDIFACT source code

A name and address (NAD) segment, containing customer ID and customer address, expressed in EDIFACT syntax: <?xml version="1.0"?> <AxdSalesOrder xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <SenderId xsi:nil="true" xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder" />
 <SalesTable class="entity" xmlns="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesOrder">
   <_DocumentHash xsi:nil="true" />
   <BankCentralBankPurposeCode xsi:nil="true" />
   <BankCentralBankPurposeText xsi:nil="true" />
   <CashDisc />
   <CommissionGroup xsi:nil="true" />
   <ConcessionContractId xsi:nil="true" />
   <ContactPersonId xsi:nil="true" />
   <CountyOrigDest xsi:nil="true" />
   <CreditCardAuthorization xsi:nil="true" />
   <CreditCardProcessorTransactionId xsi:nil="true" />
   <CurrencyCode xsi:nil="true" />
   <CustAccount>C-004262</CustAccount>
   <CustGroup xsi:nil="true" />
   <CustInvoiceId xsi:nil="true" />
   <CustomerRef />
   <DefaultDimension xsi:nil="true" />
   <DeliveryDate>2021-09-16</DeliveryDate>
   <DeliveryName xsi:nil="true" />
   <DeliveryPostalAddress xsi:nil="true" />
   <DlvMode xsi:nil="true" />
   <DlvReason xsi:nil="true" />
   <DlvTerm xsi:nil="true" />
   <EInvoiceAccountCode xsi:nil="true" />
   <Email xsi:nil="true" />
   <EndDisc xsi:nil="true" />
   <EnterpriseNumber xsi:nil="true" />
   <ExportReason xsi:nil="true" />
   <FreightZone xsi:nil="true" />
   <InterCompanyCompanyId xsi:nil="true" />
   <InterCompanyOriginalCustAccount xsi:nil="true" />
   <InterCompanyOriginalSalesId xsi:nil="true" />
   <InterCompanyPurchId xsi:nil="true" />
   <InventLocationId>VAN - 6982</InventLocationId>
   <InventSiteId xsi:nil="true" />
   <InvoiceAccount xsi:nil="true" />
   <LanguageId xsi:nil="true" />
   <LineDisc xsi:nil="true" />
   <MarkupGroup xsi:nil="true" />
   <MultiLineDisc xsi:nil="true" />
   <NumberSequenceGroup xsi:nil="true" />
   <OMInternalOrganization xsi:nil="true" />
   <Payment xsi:nil="true" />
   <PaymentSched xsi:nil="true" />
   <PaymMode xsi:nil="true" />
   <PaymSpec xsi:nil="true" />
   <PdsBatchAttribAutoRes>Yes</PdsBatchAttribAutoRes>
   <Port xsi:nil="true" />
   <PostingProfile xsi:nil="true" />
   <PriceGroupId xsi:nil="true" />
   <ProjId xsi:nil="true" />
   <PurchId xsi:nil="true" />
   <PurchOrderFormNum>SBINV2044-21-00798</PurchOrderFormNum>
   <QuotationId xsi:nil="true" />
   <Reservation>Automatic</Reservation>
   <RetailStoreId xsi:nil="true" />
   <RetailTerminalId xsi:nil="true" />
   <ReturnItemNum xsi:nil="true" />
   <ReturnReasonCodeId xsi:nil="true" />
   <ReturnReplacementId xsi:nil="true" />
   <SalesGroup xsi:nil="true" />
   <SalesId xsi:nil="true" />
   <SalesName xsi:nil="true" />
   <SalesOriginId xsi:nil="true" />
   <SalesPoolId xsi:nil="true" />
   <SalesType>Sales</SalesType>
   <SalesUnitId xsi:nil="true" />
   <ShipCarrierName xsi:nil="true" />
   <ShipCarrierPostalAddress xsi:nil="true" />
   <ShippingDateRequested>2021-09-16</ShippingDateRequested>
   <smmCampaignId xsi:nil="true" />
   <StatProcId xsi:nil="true" />
   <TaxGroup xsi:nil="true" />
   <TransactionCode xsi:nil="true" />
   <Transport xsi:nil="true" />
   <URL xsi:nil="true" />
   <VATNum xsi:nil="true" />
   <WorkerSalesResponsible xsi:nil="true" />
   <WorkerSalesTaker xsi:nil="true" />
   <ReturnedSalesOrder xsi:nil="true" />
   <DeliveryDateControlType xsi:nil="true" />
   <ShipCarrierAccount xsi:nil="true" />
   <ReceiptDateRequested>2021-09-16</ReceiptDateRequested>
   <SalesLine class="entity">
     <ActivityNumber xsi:nil="true" />
     <BarCode xsi:nil="true" />
     <BarCodeType xsi:nil="true" />
     <CountyOrigDest xsi:nil="true" />
     <CurrencyCode xsi:nil="true" />
     <CustAccount xsi:nil="true" />
     <CustGroup xsi:nil="true" />
     <CustomerRef xsi:nil="true" />
     <CustomsDocNumber_MX xsi:nil="true" />
     <CustomsName_MX xsi:nil="true" />
     <DefaultDimension xsi:nil="true" />
     <DeliveryName xsi:nil="true" />
     <DlvMode xsi:nil="true" />
     <EInvoiceAccountCode xsi:nil="true" />
     <ExternalItemId xsi:nil="true" />
     <InterCompanyInventTransId xsi:nil="true" />
     <InventDimId xsi:nil="true" />
     <InventRefId xsi:nil="true" />
     <InventRefTransId xsi:nil="true" />
     <InventTransId xsi:nil="true" />
     <InventTransIdReturn xsi:nil="true" />
     <ItemId>051-501-102-425</ItemId>
     <ItemPBAId xsi:nil="true" />
     <ItemRouteId xsi:nil="true" />
     <LedgerDimension xsi:nil="true" />
     <LineDisc>25.59</LineDisc>
     <LineHeader xsi:nil="true" />
     <LinePercent>0</LinePercent>
     <MatchingAgreementLine xsi:nil="true" />
     <Name xsi:nil="true" />
     <PdsBatchAttribAutoRes>Yes</PdsBatchAttribAutoRes>
     <Port xsi:nil="true" />
     <ProjCategoryId xsi:nil="true" />
     <ProjId xsi:nil="true" />
     <ProjLinePropertyId xsi:nil="true" />
     <ProjTransId xsi:nil="true" />
     <PropertyNumber_MX xsi:nil="true" />
     <PurchorderFormNum>SBINV2044-21-00798</PurchorderFormNum>
     <Reservation>Automatic</Reservation>
     <RetailVariantId xsi:nil="true" />
     <ReturnDispositionCodeId xsi:nil="true" />
     <SalesCategory xsi:nil="true" />
     <SalesGroup xsi:nil="true" />
     <SalesId xsi:nil="true" />
     <SalesPrice>220</SalesPrice>
     <SalesQty>800</SalesQty>
     <SalesUnit>CARTONS</SalesUnit>
     <ServiceOrderId xsi:nil="true" />
     <ShipCarrierName xsi:nil="true" />
     <StatProcId xsi:nil="true" />
     <TaxGroup xsi:nil="true" />
     <TaxItemGroup>ST 5%</TaxItemGroup>
     <TaxWithholdGroup xsi:nil="true" />
     <TaxWithholdItemGroupHeading_TH xsi:nil="true" />
     <TransactionCode xsi:nil="true" />
     <Transport xsi:nil="true" />
     <InventDim class="entity">
       <ConfigId xsi:nil="true" />
       <InventBatchId>01092122</InventBatchId>
       <InventColorId xsi:nil="true" />
       <InventDimId xsi:nil="true" />
       <InventLocationId>VAN - 6982</InventLocationId>
       <InventSerialId xsi:nil="true" />
       <InventSiteId>01</InventSiteId>
       <InventSizeId xsi:nil="true" />
       <InventStyleId xsi:nil="true" />
       <WMSLocationId xsi:nil="true" />
       <wMSPalletId xsi:nil="true" />
     </InventDim>
   </SalesLine>
 </SalesTable>

</AxdSalesOrder>

Example 3: XML/EDIFACT in a browser

The same XML/EDIFACT instance presented with help of an XSLT stylesheet: