cancel
Showing results for 
Search instead for 
Did you mean: 

XML to Tab-Delimited File in Transformation Bean on SFTP Receiver

0 Kudos

Hi Guys,

I am trying to convert a simple XML file to a tab-delimited file with headers for five fields. Below is my transformation bean, but in my output I am only

getting the first field to come back. No headers and none of the next 4 fields. Can anyone assist? Below is my code

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Ive tried that and my output I get is below:

Record

John

Thats it

manoj_khavatkopp
Active Contributor
0 Kudos

Can u try this

Xml.procesdfilednames = fromconfiguration

Xml.addheadreline=1    

manoj_khavatkopp
Active Contributor
0 Kudos

Ohhh u have 2 level i.e recordstructue too.... simplexmltoplain doesn't work in this case

0 Kudos

Manoj, using the below bean I am getting the same output

Output:

Record

John

0 Kudos

So what do I need to change in this case to get my output?

manoj_khavatkopp
Active Contributor
0 Kudos

Change message protocol in channel from xml to csv simple  to the xml to csv structural.... You can handle this

0 Kudos

So change SimpleXML2Plain   to   StructXML2Plain ?

former_member182412
Active Contributor
0 Kudos

Hi Ryan,

No need to mention documentName, documentNamespace and structureTitle, these parameters for sender adapter not for receiver. Use below parameters only.

Regards,

Praveen.

0 Kudos

Using your example above, that just gives me the below output:

Row

AA

former_member182412
Active Contributor
0 Kudos

Hi Ryan,

Show me the payload after the mapping and module parameters?

Regards,

Praveen.

former_member186851
Active Contributor
0 Kudos

Hello Ryan,

Post the sample XML and required o/p.

0 Kudos

Sample XML is below:

<orders>

     <order>

          <FirstName>John</FirstName>

          <LastName>Smith</LastName>

          <Email>JohnSmith@yahoo.com</Email>

          <OrderDate>05232016</OrderDate>

          <OrderTotal>25.99</OrderTotal>

     </order>

</orders>

Required Output is below with one record: (tab-delimited with header names of each field) (only need header fields to appear once)

FirstName     LastName                  Email                     OrderDate      OrderTotal

John              Smith            JohnSmith@yahoo.com      05232016           25.99

former_member182412
Active Contributor
0 Kudos

Hi Ryan,

I use below XML.


<myc:SenderData>

         <Row>

            <Field1>AA</Field1>

            <Field2>BB</Field2>

            <Field3>CC</Field3>

            <Field4>DD</Field4>

         </Row>

         <Row>

            <Field1>XX</Field1>

            <Field2>YY</Field2>

            <Field3>ZZ</Field3>

            <Field4>PP</Field4>

         </Row>

      </myc:SenderData>

Use below FCC.

File:

Regards,

Praveen.

0 Kudos

The example you used, Field1, Field2, Field3, Field4 need to be the names of the header.

Therefore using your input, the required output would be:

Field1       Field2       Field3    Field4

AA               BB          CC       DD

XX               YY          ZZ        PP

manoj_khavatkopp
Active Contributor
0 Kudos

xml.addHeaderLine =1