Create a variable containing a string by reading an XML file

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.

Nine 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 :-)

 

 

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog