Java EDI X12 Parser

时间:2013-07-19 06:19:14

标签: java parsing edi x12

Java中有没有好的EDI解析器API?我知道这已经asked here了,我已经完成了它。

我有一个ANSI X12 EDI文件。这是一份846库存查询文件:

ISA*00*          *00*          *01*038211983      *ZZ*JWN-DSD        *130715*1540*U*00401*000015956*0*P*}
GS*IB*038211983*JWN-DSD*20130715*1540*15956*X*004010VICS
ST*846*159560001
BIA*00*MM*9480*20130715
REF*IA*103799
LIN**UP*887873083091
QTY*33*12*EA
LIN**UP*887873083107
QTY*33*13*EA
LIN**UP*887873083114
QTY*33*10*EA
LIN**UP*887873083121
QTY*33*6*EA
LIN**UP*887873083138
QTY*33*0*EA
SCH*0*EA***018*20391231

// Many lines this

LIN**UP*886732476371
QTY*33*0*EA
SCH*0*EA***018*20391231
LIN**UP*886732476388
QTY*33*0*EA
SCH*0*EA***018*20391231
SE*3283*159560001
GE*1*15956
IEA*1*000015956

从我上面提到的链接中,我将edireader jar添加到我的Java程序中。当我给出上述文件时,输出 XML 就像这样

<ediroot xmlns="http://www.berryworkssoftware.com/2008/edireader">
<interchange Standard="ANSI X.12" Date="130715" Time="1540" StandardsId="U" Version="00401" Control="000015956">
<sender>
<address Id="038211983 " Qual="01"/>
</sender>
<receiver>
<address Id="JWN-DSD " Qual="ZZ"/>
</receiver>
<group GroupType="IB" ApplSender="038211983" ApplReceiver="JWN-DSD" Date="20130715" Time="1540" Control="15956" StandardCode="X" StandardVersion="004010VICS">
<transaction DocType="846" Control="159560001">
<segment Id="BIA">
<element Id="BIA01">00</element>
<element Id="BIA02">MM</element>
<element Id="BIA03">9480</element>
<element Id="BIA04">20130715</element>
</segment>
<segment Id="REF">
<element Id="REF01">IA</element>
<element Id="REF02">103799</element>
</segment>
<segment Id="LIN">
<element Id="LIN02">UP</element>
<element Id="LIN03">887873083091</element>
</segment>
<segment Id="QTY">
<element Id="QTY01">33</element>
<element Id="QTY02">12</element>
<element Id="QTY03">EA</element>
</segment>
<segment Id="LIN">
<element Id="LIN02">UP</element>
<element Id="LIN03">887873083107</element>
</segment>
<segment Id="QTY">
<element Id="QTY01">33</element>
<element Id="QTY02">13</element>
<element Id="QTY03">EA</element>
</segment>
<segment Id="LIN">
<element Id="LIN02">UP</element>
<element Id="LIN03">887873083114</element>
</segment>
<segment Id="QTY">
<element Id="QTY01">33</element>
<element Id="QTY02">10</element>
<element Id="QTY03">EA</element>
</segment>
<segment Id="LIN">
<element Id="LIN02">UP</element>
<element Id="LIN03">887873083121</element>
</segment>
<segment Id="QTY">
<element Id="QTY01">33</element>
<element Id="QTY02">6</element>
<element Id="QTY03">EA</element>
</segment>
<segment Id="LIN">
<element Id="LIN02">UP</element>
<element Id="LIN03">887873083138</element>
</segment>
<segment Id="QTY">
<element Id="QTY01">33</element>
<element Id="QTY02">0</element>
<element Id="QTY03">EA</element>
</segment>
<segment Id="SCH">
<element Id="SCH01">0</element>
<element Id="SCH02">EA</element>
<element Id="SCH05">018</element>
<element Id="SCH06">20391231</element>

//Many lines

</segment>
</transaction>
</group>
</interchange>
</ediroot>

不知道它的正确与否。但问题是 edireader 不在maven中。所以我们必须手动添加。因此,如果新版本的EDI出现,将来不会使用相同的 edireader

我认为

Smooks无法读取X12。我觉得它没用。它需要有一些配置文件来读取文件。因此,对于x12文件的每种类型,我将需要不同的配置

那么有什么好的 Java EDI X12 Parser API

0 个答案:

没有答案