repetition element handling

12 views
Skip to first unread message

Serena Angelucci

unread,
Feb 5, 2025, 5:21:20 AMFeb 5
to Smooks Users
Hello guys, 
I have a question regarding the repetitionSeparator that seems not working in my code.
In the smooks-response-config.xml I defined:


<edi:unparser schemaUri="/edi-mapping-1p-response.dfdl.xsd" unparseOnNode="*" segmentTerminator="'" dataElementSeparator="+" compositeDataElementSeparator=":" escapeCharacter="?" repetitionSeparator="*" />

In the dfdl I defined the field in this way:

<xsd:element dfdl:initiator="CON" name="cont" minOccurs="0" maxOccurs="1" dfdl:ref="ibmEdiFmt:EDISegmentFormat">

<xsd:complexType>

<xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">

<xsd:element name="contactInformation" minOccurs="0" maxOccurs="5">

<xsd:complexType>

<xsd:sequence dfdl:ref="ibmEdiFmt:EDICompositeSequenceFormat">

<xsd:element name="partyQualifier" type="xsd:string" minOccurs="1" maxOccurs="1"/>

<xsd:element name="communicationNumber" type="xsd:string" minOccurs="1" maxOccurs="1"/>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:sequence>

</xsd:complexType>

</xsd:element>


The edifact that is produced is:


CON+14:44 (0)141 611 7100+900:44 (0)141 611 7100


with + as separator, but what I should have is:


CON+14:44 (0)141 611 7100*900:44 (0)141 611 7100


How can I get it?

Is it possible to define a custom writer to achieve that?


Thanks in advance for your help,

Ser4ena

Claude Mamo

unread,
Feb 5, 2025, 11:47:48 AMFeb 5
to smook...@googlegroups.com
Haven't looked too closely but at first glance I'd say contactInformation should be enclosed within a ibmEdiFmt:EDISegmentPartRepeatSequenceFormat sequence:

    <xsd:element dfdl:initiator="CON" name="cont" minOccurs="0" maxOccurs="1" dfdl:ref="ibmEdiFmt:EDISegmentFormat">
        <xsd:complexType>
            <xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentSequenceFormat">
                <xsd:sequence dfdl:ref="ibmEdiFmt:EDISegmentPartRepeatSequenceFormat">

                    <xsd:element name="contactInformation" minOccurs="0" maxOccurs="5">
                        <xsd:complexType>
                            <xsd:sequence dfdl:ref="ibmEdiFmt:EDICompositeSequenceFormat">
                                <xsd:element name="partyQualifier" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                                <xsd:element name="communicationNumber" type="xsd:string" minOccurs="1" maxOccurs="1"/>
                            </xsd:sequence>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
--
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 visit https://groups.google.com/d/msgid/smooks-user/4a7f13cd-f185-4294-a98a-c03216734321n%40googlegroups.com.

Serena Angelucci

unread,
Feb 5, 2025, 12:05:16 PMFeb 5
to smook...@googlegroups.com
Reply all
Reply to author
Forward
Message has been deleted
0 new messages