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.  Need to embed one xml content into another

    Posted 07/10/12 04:04 AM

    Originally posted by: SystemAdmin


    I have a situation in which I have to generate one xml, and embed that xml in another xml. I am trying to simplify my problem with an example -

    Consider I have 2 xsd's - employee.xsd and salary.xsd.
    salary.xsd generates an xml in which I have the split of my salary structure. So, a very basic salary.xml would look like -
    <salary>
    <basic>1000</basic>
    <tax>50</tax>
    <HRA>123</HRA>
    </salary>

    employee.xsd generates an xml in which we have all the details of an employee like name, age, DOB and a also tag called as salarystructure. I want to embed the salary xml (shown above) inside this salarystructure tag. So, a very basic employee.xml would look like:

    <employee>
    <name>Anannya</name>
    <age>26</age>
    <DOB>3rd Feb</DOB>
    <salarystructure>
    <salary>
    <basic>1000</basic>
    <tax>50</tax>
    <HRA>123</HRA>
    </salary>
    </salarystructure>
    </employee>

    Can anyone please let me know how to do this in WTX? I tried using 2 output cards with the "Onsuccess -> append" option applied for the 2nd one, but the salary xml gets appended to the employee xml at the very end i.e. at after the </employee> tag. This is not what I want. I want to EMBED it in between. Any inputs?
    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Need to embed one xml content into another

    Posted 08/08/12 05:12 AM

    Originally posted by: SystemAdmin


    First thing first, there should be a relationship qualifier which should exist to embed something like this.

    Assuming you would embed using the employee number and it is available in both the salary and Employee XSDs, I would create a new structure with the desired XSD and use a functional map to iterate through the employee records and fetch the appropriate salary record to be embedded into it.
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange