Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need to read the XML data using tFileInputXml Component. But, I am not getting how to give Xpath queries.
Here is the tag tree of my data.
<p> <table border='1' width='90%' align='center' summary='Script output'> <tr> <th scope="col">ColumnName1</th> <th scope="col">ColumnName2</th> <th scope="col">ColumnName3</th> <th...remaining header tags</th> </tr> <tr> <td>ABCDEFGH ENERGIA LTDA.</td> <td>APPROVED</td> <td>IVY XYZ</td> <td>6097</td> <td .. remainig td's></td> </tr> </table> </p>
Please suggest me how to fill in the columns for the xml component. I did try it as in the below screenshot and other ways also. But data is not aligned in expected rows and columns (It is reading only first td for each row).
I am new to Talend. So please help me out in this.
Thanks in advance.
Hi @JeevithaS
Your XML contains multiple loops under a parent which is not possible to read through tFileInputXML.
Hence you have to use tXMLMap or Talend Data Mapper.
Please follow the job flow as attached and let us know if it is serving your requirement.
Make sure you save the input to a file then remove all the new lines as Document type will read total data as one line. In tXMLMap you can define two loops for header and detail and you can mention same in tXMLMap Source Loop Tree.
Thanks and Regards,
Subhadip
Hi @subhadip13 ,
Thanks for your response.
I tried in your way. But The Data is not getting aligned in the proper way when i am trying to insert in Excel file. Same as before, each data is storing as single row. I need to transpose the data as one complete tr loop should be stored as one row in excel file with each td value as cell value for that row.
I need to loop tr node and each td value inside the tr node should be mapped to different column names which we will define as schema for output component. I hope you got it.
Anyway, I am able to pull the data using tHttpTableInput. Thank you so much for your effort