Hi,
I generated an XML using a Flat File for ORDERS 01B. The snippet is below:
UNA:+.? '
UNB+UNOC:3+SENDER ID💤A1B2C3D4E5+RECEIVER ID💤A1B2C3D4E5+20151128:1037+1++++1++1'
UNH+1+ORDERS:D:01B:UN:EAN010'
An XML file was generated (I have identified another bug but will list that separately). I then took the XML and tried to perform a reverse conversion (back to flat file). The UNA segment value changes slightly and an extra + is added:
UNA+:+.?*'
UNB+UNOC:3+SENDER ID💤A1B2C3D4E5+RECEIVER ID💤A1B2C3D4E5+20151128:1037+1++++1++1'
UNH+1+ORDERS:D:01B:UN:EAN010'
If I then repeat the step to convert it from Flat file to XML the parser fails:
Transform - convert EDI Flat File to XML...
Data file '../in/ORDERS_D01B-Output.txt' loaded...
Oct 28, 2019 7:26:28 PM com.sapstern.openedifact.sax.EdifactSaxParserToXML parse
INFO: xsdFileName EDIFACTINTERCHANGE_EAN010_null
ERROR: 'Unable to load resource: EDIFACTINTERCHANGE_EAN010_null.xsd'
javax.xml.transform.TransformerException: org.xml.sax.SAXException: Unable to load resource: EDIFACTINTERCHANGE_EAN010_null.xsd
org.xml.sax.SAXException: Unable to load resource: EDIFACTINTERCHANGE_EAN010_null.xsd
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(Unknown Source)
at com.sapstern.openedifact.sax.EdifactSaxParserToXML.parseEdifact(EdifactSaxParserToXML.java:1104)
at com.sapstern.openedifact.sax.EdifactSaxParserToXML.parseEdifact(EdifactSaxParserToXML.java:1080)
at com.sap.converters.edi.ConvertEDIFlatToXML.process(ConvertEDIFlatToXML.java:87)
at com.sap.converters.edi.ConvertEDIFlatToXML.main(ConvertEDIFlatToXML.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.xml.sax.SAXException: Unable to load resource: EDIFACTINTERCHANGE_EAN010_null.xsd
org.xml.sax.SAXException: Unable to load resource: EDIFACTINTERCHANGE_EAN010_null.xsd
at com.sapstern.openedifact.sax.AbstractEdifactParser.setupXSDDOM(AbstractEdifactParser.java:45)
at com.sapstern.openedifact.sax.EdifactSaxParserToXML.setupTreeOfEdifactSegments(EdifactSaxParserToXML.java:512)
at com.sapstern.openedifact.sax.EdifactSaxParserToXML.parse(EdifactSaxParserToXML.java:421)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(Unknown Source)
... 11 more
Caused by: org.xml.sax.SAXException: Unable to load resource: EDIFACTINTERCHANGE_EAN010_null.xsd
at com.sapstern.openedifact.sax.AbstractEdifactParser.getIS(AbstractEdifactParser.java:64)
at com.sapstern.openedifact.sax.AbstractEdifactParser.setupXSDDOM(AbstractEdifactParser.java:41)
... 14 more
Hi Brian,
it is ab bug, I will look into this.
It seems to have something to do with the handling of the UNA segment.
Did you try what you did omitting the UNA?
Best
Matthias
Hi Matthias,
Apologies for not responding earlier. Work gets in the way :-)
I believe I did remove the additional + (i.e. UNA+:+.?' -> UNA:+.?') and then it was able to determine the Message Type and Version.
cheers
Brian
I just saw, we already discussed this problem.
I will have a look into the UNA problem, as this seems to be at the origin of the trouble