IBM Sterling Transformation Extender

Sterling Transformation Extender

Come for answers, stay for best practices. All we're missing is you.


#Sterling
#Supplychain
 View Only
Expand all | Collapse all

XML Mapping - schema elements with minoccurs 0 not appearing

  • 1.  XML Mapping - schema elements with minoccurs 0 not appearing

    Posted 12/14/11 01:55 PM

    Originally posted by: SystemAdmin


    Hi,
    I guess the tool does not include elements that are defined a minoccurs of 0, if the value is null or empty.
    Want to know whether this behavior can be overridden?
    I am using a service schema that has some 150 elements defined with minoccurs 0 but the service is expecting these tags ( A possible bug at their end that they would fix later)
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 2.  Re: XML Mapping - schema elements with minoccurs 0 not appearing

    Posted 12/16/11 11:48 AM

    Originally posted by: jvanboga


    Without seeing your type tree I would say the element does not appear on the output because based on type tree design.... Alter the type tree and it will appear...

    In the example below the elements are defined as text min 0 while the value in parens represents the occurs requirements.

    <group>
    <sgroup1></sgroup1> (0:s)
    <sgroup2></sgroup2> (0:s)
    </group> (0:s)

    Using the above format if sgroup1 and sgroup2 have zero bytes the group will not appear in your output. If one or the other of the sgroups has data group will get written.

    If sgroup1 has data and sgroup2 does not sgroup 2 will not appear. If the revese is true sgroup1 will not appear.

    <group><sgroup1>element_1_data</sgroup1></group>
    <group><sgroup2>element_2_data</sgroup2></group>

    change the tree to the following and the elements will always appear data or not:

    <group>
    <sgroup1></sgroup1> (1:s)
    <sgroup2></sgroup2> (1:s)
    </group> (1:s)

    the scenario above will loor like this:

    <group><sgroup1>element_1_data</sgroup1><sgroup2></sgroup2></group>
    <group><sgroup1></sgroup1><sgroup2>element_2_data</sgroup2></group>

    Hope that helps.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange