IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
  • 1.  CSV to XML

    Posted Fri March 10, 2017 09:21 AM

    Originally posted by: JWienhusen


    Hey everyone.

    Im currently working as a trainee and got a task to work with wtx.
    Since im completly new to wtx i got a ton of problems with it.

    I thought that i could maybe work on it on the weekend so i could shine with my results next week, but unfortunatly im not getting very far.

     

    I got a simple CSV as input and i should get a xml as output.

    CSV:

    A;B;C

    D;E;F

    G;H

     

    XML:

    <?xml version="1.0"?>

    -<RootItem>


    -<Item>

    <Column0>A</Column0>

    <Column1>B</Column1>

    <Column2>C</Column2>

    </Item>


    -<Item>

    <Column0>D</Column0>

    <Column1>E</Column1>

    <Column2>F</Column2>

    </Item>


    -<Item>

    <Column0>G</Column0>

    <Column1>H</Column1>

    </Item>

    </RootItem>

    I already created a valid and wellformed xsd for my xml

    XSD:

    <?xml version ="1.0"?>
    <xs:schema attributeFormDefault="unqualified"
    elementFormDefault="qualified"
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="RootItem">
             <xs:complexType>
              <xs:sequence>
                <xs:element name="Item" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                         <xs:element name="Column0" type="xs:string"/>
                         <xs:element name="Column1" type="xs:string"/>
                         <xs:element name="Column2" type="xs:string" minOccurs="0"/>
                        </xs:sequence>
                      </xs:complexType>
                </xs:element>
              </xs:sequence>
             </xs:complexType>
        </xs:element>
    </xs:schema>

     

    Since i have barely any knowledge about mapping and i dont have any contact person on the weekend i thought i would ask in this forum.

    I would gladly take any hints or tips that would make it easier for me to understand what i need to do.

    Thanks in advance! :)


    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender
    #DataExchange


  • 2.  Re: CSV to XML

    Posted Fri March 10, 2017 03:05 PM

    Originally posted by: DeM0n


    Here you go...attached are the map, trees and test files....that's basically what you want to do....

    I took your XSD and imported into WTX designer to create the XML type tree....

    Go through the map and see if that makes sense to you....But if you know nothing about WTX at all the it might be difficult to understand....then all I can say is that try to understand it to see whats going on...


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange

    Attachment(s)

    mtt
    inputCSV.mtt   6 KB 1 version
    txt
    TestCSV.txt   19 B 1 version
    mtt
    OutXML.mtt   16 KB 1 version
    xml
    OutXML.xml   220 B 1 version
    mms
    CSVtoXML.mms   1 KB 1 version


  • 3.  Re: CSV to XML

    Posted Sat March 11, 2017 04:24 AM

    Originally posted by: JWienhusen


    Thank you very much!

    If i have any more questions ill surely ask here or my contact person in the company!

    Anyway thank you and have a nice day =)


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender