views:

793

answers:

5

Parsing EDIFACT can be a daunting undertaking. Is there any good open source library that can help?

A: 

Parsing EDIFACT is easy. You can find many libraries to do it. For example,

http://code.google.com/p/edicoder/

All these libraries simply break up the messages into segments.

The hard part with EDIFACT is to transform the message into some meaningful objects. This is very application specific and I doubt you will find any libraries. Even if you find one, it will be specific to a narrow field, like hotel reservation.

ZZ Coder
Edicoder looks like it hasn't actually implemented any parsing code yet. I agree regarding EDIFACT transformations.
Johannes Brodwall
+2  A: 

www.smooks.org - A template-based text parser. They have suitable EDI examples that I was looking to use to implement for Walmart 810s before they dumped my products.

Chris Kaminski
Smooks seems to be extremely XML-heavy, but otherwise looks mature and good.
Johannes Brodwall
It is. I'd like to see something like commons-digester for EDIFACT, honestly. Before I stopped doing EDI altogether, I was thinking about using Smooks to do something similar, straight EDI-text to POJO.
Chris Kaminski
+1  A: 

try: http://bots.sourceforge.net not so much a library, but translates edifact to the format you prefer....xml....csv....etc

eppye
A: 

@Johannes Brodwall @Chris Kaminski

I think ye must be talking about the Smooks EDI Mapping Models when you say it's "extremely XML-heavy". More or less all Smooks specific configuration can be performed programaticaly.

We are working on a number of things to make EDI consumption via Smooks easier:

  1. EDIFACT Conversion Tool (ECT): Generate EDI Mapping Models (the "extremely XML-heavy" bits I think you are talking about) directly from their specs. We're close to completing our first one of these for UN/EIFACT. Will hopefully be adding more in the future... X12, HL7 etc
  2. EDIFACT Java Compiler (EJC): Generate Java object models from EDI Mapping Models. Similar to JAXB's XJC tool. Includes generation of a simple Factory class through which you can perform fromEDI and toEDI operations on the generated Java object model e.g.: https://svn.codehaus.org/milyn/trunk/smooks-examples/ejc/ejc-use/src/main/java/example/Main.java

Put ECT and EJC together...

A: 

If you are interested by EDIFACT parsing, you should have a look at my preliminary work at

http://parse-edifact.net/

/Patrice - http://babelabout.blogspot.com/

Babelabout