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,
I am a bit at a loss with this ticket.
The parser is not able to load the xsd. The Filename looks weird. Usually the filename of the xsd is constructed from the Info sitting in the UNH segment.
UNH+1+ORDERS:D:01B:UN:EAN010' => So it would pick up ORDERS and 01B here for the filename:
EDIFACTINTERCHANGE_ORDERS_01B.xsd
But it sets up
EDIFACTINTERCHANGE_EAN010_null.xsd
Plz try it without the UNA segment.
Maybe it has to do something with it.
Then we would have an idea where the problem lies.
Best Matthias