Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edifact-schemas:d93a -> Cannot resolve the name 'D93A:SPS-SamplingParametersForSummaryStatiC1DTMDateTimePeriod' #295

Closed
deradam opened this issue May 5, 2020 · 5 comments
Assignees
Labels
status: wont do/fix This will not be worked on

Comments

@deradam
Copy link

deradam commented May 5, 2020

Hi team,

I wanted to parse an edifact file using smooks on d93a directory and had the following issue:

Caused by: org.smooks.cdr.SmooksConfigurationException: org.smooks.cdr.SmooksConfigurationException: java.lang.RuntimeException: Schema Definition Error: Error loading schema due to org.xml.sax.SAXParseException; systemId: jar:file:/Users/user/.m2/repository/org/smooks/cartridges/edi/edifact-schemas/2.0.0-SNAPSHOT/edifact-schemas-2.0.0-20200503.064839-16-d93a.jar!/d93a/EDIFACT-Messages.dfdl.xsd; lineNumber: 5045; columnNumber: 211; src-resolve: Cannot resolve the name 'D93A:SPS-SamplingParametersForSummaryStatiC1DTMDateTimePeriod' to a(n) 'type definition' component.
Schema context: file:/var/folders/dt/kh2b6dzs0kn01ytwdr9ml9n80000gn/T/EDIFACT-Interchange13258740284105143729.dfdl.xsd Location in file:/var/folders/dt/kh2b6dzs0kn01ytwdr9ml9n80000gn/T/EDIFACT-Interchange13258740284105143729.dfdl.xsd

It seems that the EDIFACT-Messages.dfdl.xsd contains an unkown type here

            <xsd:element maxOccurs="200" minOccurs="0" name="SegGrp-5">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:sequence dfdl:initiatedContent="yes">
                            <xsd:element dfdl:initiator="LIN" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="1" minOccurs="1" name="LIN" type="D93A:LIN-LineItem"/>
                            <xsd:element dfdl:initiator="PIA" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="10" minOccurs="0" name="PIA" type="D93A:PIA-AdditionalProductId"/>
                            <xsd:element dfdl:initiator="IMD" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="10" minOccurs="0" name="IMD" type="D93A:IMD-ItemDescription"/>
                            <xsd:element dfdl:initiator="MEA" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="10" minOccurs="0" name="MEA" type="D93A:MEA-Measurements"/>
                            <xsd:element dfdl:initiator="PSD" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="1" minOccurs="0" name="PSD" type="D93A:PSD-PhysicalSampleDescription"/>
                            <xsd:element dfdl:initiator="SPS" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="10" minOccurs="0" name="SPS" type="D93A:SPS-SamplingParametersForSummaryStatiC1DTMDateTimePeriod"/>
                            <xsd:element dfdl:initiator="QTY" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="10" minOccurs="0" name="QTY" type="D93A:QTY-Quantity"/>
                            <xsd:element dfdl:initiator="FTX" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="5" minOccurs="0" name="FTX" type="D93A:FTX-FreeText"/>
                        </xsd:sequence>

The type D93A:SPS-SamplingParametersForSummaryStatiC1DTMDateTimePeriod is missing.

I am using the latest 2.0.0-SNAPSHOT builds in Mac with Java 11.

Thanks and cheers!

@deradam
Copy link
Author

deradam commented May 5, 2020

Seems it's the same issue with the other directories (d94 to d98) and maybe also others.

@deradam
Copy link
Author

deradam commented May 5, 2020

I guess that the issue is the edg parser. The element

<xsd:element dfdl:initiator="SPS" dfdl:ref="ibmEdiFmt:EDISegmentFormat" maxOccurs="10" minOccurs="0" name="SPS" type="D93A:SPS-SamplingParametersForSummaryStatiC1DTMDateTimePeriod"/>

is based on the following segment group definition. Seems like it does not like the missing space between the name and the "C".

  --- Segment Group 5 ------------------------------- C    200 ------+
  LIN  Line item                            M      1                 |
  PIA  Additional product id                C     10                 |
  IMD  Item description                     C     10                 |
  MEA  Measurements                         C     10                 |
  PSD  Physical sample description          C      1                 |
  SPS  Sampling parameters for summary statiC      1                 |
  DTM  Date/time/period                     C     10                 |
  QTY  Quantity                             C     10                 |
  FTX  Free text                            C      5                 |

@claudemamo claudemamo self-assigned this May 5, 2020
@deradam
Copy link
Author

deradam commented May 5, 2020

I guess the issue is in this pattern (https://github.com/smooks/smooks-edi-cartridge/blob/master/ect/src/main/java/org/smooks/edi/ect/formats/unedifact/UnEdifactMessage.java#L80)

The correct one removes the whitespace in front of the M|C|m|c
(\d{4,5})[-+* XS](\w{3}) (.)(M|C|m|c) (\d+)[ |]

The correct one can be tested here -> https://regex101.com/r/Gxfvsf/1

@claudemamo
Copy link
Member

claudemamo commented May 5, 2020

Hi Adam, can you open the ticket and report your findings in the EDI cartridge repo (https://github.com/smooks/smooks-edi-cartridge/issues/new)?

@deradam
Copy link
Author

deradam commented May 5, 2020

Hi Adam, can you open the ticket and report your findings in the EDI cartridge repo (https://github.com/smooks/smooks-edi-cartridge/issues/new)?

Yep, done -> smooks/smooks-edi-cartridge#26

@deradam deradam closed this as completed May 5, 2020
@claudemamo claudemamo added the status: wont do/fix This will not be worked on label May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: wont do/fix This will not be worked on
Development

No branches or pull requests

2 participants