2

Java中有没有好的EDI解析器API?我知道这已经在这里问过了,我已经完成了。

我有一个 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吗?

4

0 回答 0