Project Description
Simple easy to use EDI (X12 and EDIFACT) reading\writing library + XmlReader\XmlWriter implementations over EDI data.

EdiStreamReader - simple interface for reading EDI streams.
            using (EdiStreamReader rd = new EdiStreamReader(File.OpenRead(@"myedifile.edi")))
                DataSegment seg = rd.ReadSegment();
                while (null != seg)
                    //do something with the segment
                    seg = rd.ReadSegment();

EdiStreamWriter - write EDI stream
            using (EdiStreamWriter wr = new EdiStreamWriter(File.Create(@"myedifile.edi"), EdiReaderWriterSettings.DefaultX12))
                DataSegment segIsa = new DataSegment("ISA");
                segIsa[5][0] = "ZZ";
                segIsa[6][0] = "SENDER";
                // ....
                //create more segments

EdiXmlReader - XmlReader implementation over EdiData. Produces XML like
    <E2>          </E2>
    <!-- ... -->
  <!-- ... -->

EdiXmlReader class does not use maps\schemas and can only produce plain XML structure, no nested XML structures for loops, etc...

EdiXmlWriter - basic XmlWriter implementation. Writes XML directly to EDI file. Now you can use XSLT to transform EDI to EDI, also you can create XML documents and serialize them to EDI. Structure of the XML data must be the same as produced by EdiXmlReader (see XML example above).
Usage idea:
            EdiXmlReader ediXmlReader = new EdiXmlReader(...);
            EdiXmlWriter ediXmlWriter = new EdiXmlWriter(...);

            XslCompiledTransform transform = new XslCompiledTransform();

            transform.Transform(ediXmlReader, ediXmlWriter);

EdiNet.Test uses xUnit NuGet package
See unit tests for more usage examples or ask questions here.

Last edited Sep 25, 2013 at 9:40 PM by burokio, version 5