Parsing EDIFACT can be a daunting undertaking. Is there any good open source library that can help?
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.
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.
try: http://bots.sourceforge.net not so much a library, but translates edifact to the format you prefer....xml....csv....etc
@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:
- 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
- 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...
If you are interested by EDIFACT parsing, you should have a look at my preliminary work at
/Patrice - http://babelabout.blogspot.com/