Is there any good X12 parser in Java? [closed]

泄露秘密 提交于 2019-12-03 00:42:39

Try this, edireader

The parser differentiates between ANSI X.12 and EDIFACT EDI standards by inspection and uses a factory pattern to construct an appropriate parser subclass.

The parser can be embedded within your Java application in the same way as you would an XML parser, avoiding the file-based and proprietary interfaces often used with conventional EDI translators.

Try using Smooks. From the page:

Smooks is an extensible framework for building applications for processing XML and non XML data (CSV, EDI, Java, etc) using Java.

If you are open to a commercial product, have a look at the Oakland Data Transformer. It's written in Java, has an Eclipse-based designer, and a Java API or integration with Apache Camel, Mule ESB, and OSGi Blueprint. You can easily graphically map it to XML, database, Java objects or other things.

You will need to contact Oakland Software when you download it to get the specifications for the X12 4010 810 which is what you are using.

you could try bots: http://bots.sourceforge.net it is not java, but python. it is not a 'library' but an application. handles x12 OK, incl 810. You can translate it to the format you need (xml, csv, flat file)

We can use apache camel, camel is very easy and extensible solution of this,

This will give a json objects, afterthat we can parse the json objects then get the values.

XmlJsonDataFormat xmlJsonFormat = new XmlJsonDataFormat();
        xmlJsonFormat.setEncoding("UTF-8");
        xmlJsonFormat.setForceTopLevelObject(true);
        xmlJsonFormat.setTrimSpaces(true);
        xmlJsonFormat.setRootName("newRoot");
        xmlJsonFormat.setSkipNamespaces(true);
        xmlJsonFormat.setRemoveNamespacePrefixes(true);
    //  xmlJsonFormat.setExpandableProperties(Arrays.asList("d", "e"));

          from("file:sftpdata/x12files")
            .log("Before unmarshal with SmooksDataFormat:").log("${body}")
            .unmarshal(new SmooksDataFormat("smooks-config1.xml"))
            .log("After unmarshal with SmooksDataFormat:").log("${body}")
           .marshal(xmlJsonFormat)
             .log("After marshalling with Json library:").log("${body}")
             .process(new X12Processor()).log("X12 file processed")
            .to("mock:result");
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!