Create a variable containing a string by reading an XML file

Highlighted
Four Stars

Create a variable containing a string by reading an XML file

Hi everyone, I'm new on talend.
I have an XML file from which I read some parameters, after which with these parameters I have to construct a string to save in a global variable which will then be called in the tSOAP element. the string to be created must be of the following type:

 

000002;000001;18000101;HRANAGRAPHIC;IDPRCATE;;001||000002;000001;18000101;HRANAGRAPHIC;NAME;;001||000002;000001;18000101;HANAGRAPHIC;SURNAME;;001 

where ";" separates each parameter I read from my XML, while "||" separate each record I always read from my XML. Someone very kindly could tell me the work flow I have to implement to do this. I would be very grateful.

Seven Stars

Re: Create a variable containing a string by reading an XML file

I suggest you first read you XML file and format to CSV,

tFileInputMSXML ---> tLogRow

After that step, we can then help
Regards
DGM
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Employee

Re: Create a variable containing a string by reading an XML file

Hi,

 

     You can read the XML data through XML parsing components of Talend and get the output records. Like dgm suggested, you can push the data to an interim file with your specific data separation requirements to use semicolon and double pipe.

image.png

 

This interim file can be used to process the data further in your flow. Since you are making an interim file, please remember to delete this file after your use as a house keeping measure.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved :-)

 

 

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch