metormote / edifact-xml Goto Github PK
View Code? Open in Web Editor NEWA complete java parser library for converting UN Edifact messages to XML
A complete java parser library for converting UN Edifact messages to XML
Hi,
In case you want to revert the generated XML back to Edifact format you might use attached Java program. Please note that changing the order of the XML elements, or adding / removing them, will result in an incorrect Edifact message.
Best regards,
tdijk
In the current version, only decimal notation with a dot is allowed. If a comma is specified in the UNA segment, an error occurs. Why was no comma taken into consideration in the code? Is there a reason for this? Because there are EDI data which contain a comma in the UNA segment.
Note:
If I understand it correctly, in the EdifactReader class the constant with DECIMAL is initialised with '.'. And this constant is used to check the decimal notation in the UNA segment.
Hi,
First thanks for this library, it really help me for my actual work.
I'm not 100% sure of my subject here and I don't have access to the ISO-TS 20625-200 norm, so I let you evaluate my remark.
I generated an XML file from an INVOICE 01B and according to me, there is some non-necessary elements.
I'll take the NAD for example.
In my input file:
NAD+SU+1234567890123::9'
With your library:
<S_NAD>
<D_3035>BY</D_3035>
<C_C082>
<D_3039>5400110000030</D_3039>
<D_1131 />
<D_3055>9</D_3055>
</C_C082>
</S_NAD>
According to the EDIFACT norm, the data element D_1131 isn't mandatory but conditional (https://www.truugo.com/edifact/d01b/invoic/)
So according to me, the tag should not be present.
There is a lot of similar cases and if I try to validate your generated file with XSD I found, I've got issues because according to that XSD, this is not a mandatory element.
It will be convenient to have Maven or Gradle build definition to use this library as a dependency.
When calling EdifactParser.parse(InputSource inputSource)
with inputSource
, which is created not from character stream (byte stream in my case), reader initialization is done correctly but then there is a strange line of code with exception being thrown, which fails parsing process.
I assume it is a typo, that this line of code exists, because there is no execution path in if-else cases above that leads to reader
being not initialized.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.