IBM Sterling Transformation Extender

Sterling Transformation Extender

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


#Sterling
#Supplychain
 View Only
  • 1.  Gererate dyamic XML output

    Posted 09/19/08 03:57 PM

    Originally posted by: SystemAdmin


    Can anyone tell me how to generate dynamic XML document in WTX?

    I'm getting an input message with name/value pairs that looks something like this:
    <<message>
    <line>
    <attr name="value1" value="xyz"/>
    <attr name="value2" value="yy"/>
    </line>
    <line>
    <attr name="value1" value="zzzz"/>
    <attr name="value3" value="Wwwwww"/>
    <attr name="value4" value="vvvvvv"/>
    </line>
    </message>

    And I would like to the generate the following XML output were the names from the input message are dynamic tag names in the output:
    <master>
    <detail>
    <value1>xyz</value1>
    <value2>yy</value2>
    </detail>
    <detail>
    <value1>zzzz</value1>
    <value3>Wwwwww</value3>
    <value4>vvvvvv</value4>
    </detail>
    </master>

    Regards,
    Håkan.
    #IBMSterlingTransformationExtender
    #DataExchange
    #IBM-Websphere-Transformation-Extender


  • 2.  Re: Gererate dyamic XML output

    Posted 09/19/08 04:43 PM

    Originally posted by: SystemAdmin


    I'm not aware of an elegant way to do it but I've done it by just building the output element by element. e.g.:

    TextField[n]="<">" + value[1] + "</">"

    Of course, you would call a functional map to build the indeterminate number of detail entries rather than hardcoding indices.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 3.  Re: Gererate dyamic XML output

    Posted 09/19/08 04:44 PM

    Originally posted by: SystemAdmin


    I'm not aware of an elegant way to do it but I've done it by just building the output element by element. e.g.:

    "TextField[n]="<">" + value[1] + "</">""

    Of course, you would call a functional map to build the indeterminate number of detail entries rather than hardcoding indices.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 4.  Re: Gererate dyamic XML output

    Posted 09/19/08 05:01 PM

    Originally posted by: SystemAdmin


    TextField[1]= "<"+ name:attr + ">" + value:attr + "</" + name:attr + ">"

    Hopefully, the above should display the way I want it to.
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender