Edifact unparser issue related to some sequences

50 views
Skip to first unread message

Axel Guckelsberger

unread,
Jan 9, 2024, 9:19:33 AMJan 9
to Smooks Users
Hello,

I am overhauling our test suite using the RC3 release and gladly found that several issues are now gone away. The unparse process is still giving me some problems though and I want to share one particular one with you, hoping for some advice or assistance.

The following example uses a sample order from https://wiki.folio.org/display/ACQ/Sample+EDIFACT+Orders
I attached this as "Example_wiki_folio_raw.edi".When I parse this using Smooks the result is what I attached as "Example_wiki_folio_infoset.edi". Now when I try to unparse it again I receive an exception (attached as "exception_trace.txt").

The interesting part is:

Caused by: org.apache.daffodil.japi.DaffodilUnparseErrorSAXException: Runtime Schema Definition Error: Non-empty string required.
Schema context: sequence[1] Location line 391 column 11 in .../ceb0086d965a9d43ef05c51d5f231a50d77efa6c/edifact-schemas-2.0.0-RC3-d96a.jar!/d96a/EDIFACT-Segments.dfdl.xsd

Which refers to this schema part:

   <xsd:element name="CUX-Currencies" type="D96A:CUX-Currencies"/>
   <xsd:complexType name="CUX-Currencies">
      <xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
         <xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentPartRepeatSequenceFormat">
            <xsd:element dfdl:nilKind="literalValue"
                         dfdl:nilValue="%ES;"
                         dfdl:useNilForDefault="no"
                         maxOccurs="2"
                         minOccurs="0"
                         name="C504"
                         nillable="true"
                         type="D96A:C504-CurrencyDetails"/>
         </xsd:sequence>


When I remove the CUX element entirely from the sample file, the issue pops up again for another segment (but again refering to a sequence).

Maybe you could try whether you can reproduce this which would confirm it is a bug.

Thanks in advance,
Axel

Example_wiki_folio_infoset.edi
Example_wiki_folio_raw.edi
exception_trace.txt

Claude Mamo

unread,
Jan 12, 2024, 11:39:35 AMJan 12
to smook...@googlegroups.com
The culprit is the missing content in RepeatSeparator in your XML. When Smooks ingests the EDIFACT file, the repetition separator is <RepeatSeparator> </RepeatSeparator> which is correct because the repetition separator is defined as a whitespace in the UNA segment. However, your XML has <RepeatSeparator/> instead of <RepeatSeparator> </RepeatSeparator> which is incorrect. I can't say for certain why the whitespace is not present in your XML but I've observed that, for some weird reason, my IntelliJ formatter is removing the whitespace from RepeatSeparator when I format the XML. It's possible that the same happened to you when you manually copied the XML output over to a file.

Claude

--
You received this message because you are subscribed to the Google Groups "Smooks Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smooks-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/smooks-user/aad6dd05-f215-4ec8-bf46-2c2a2724d564n%40googlegroups.com.

Axel Guckelsberger

unread,
Jan 15, 2024, 4:44:58 AMJan 15
to Smooks Users
Thank you very much, Claude. This was indeed causing the issue. It happened because I processed the output using SAXBuilder. After removing that, the tag was correct again.

Axel
Reply all
Reply to author
Forward
0 new messages