Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Read XML File using tFileInputXML component - Not Reading data properly

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).

0683p000009M5R8.png

I am new to Talend. So please help me out in this. 

Thanks in advance.

Labels (3)
2 Replies
Anonymous
Not applicable
Author

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.

 

0683p000009M5gj.jpg0683p000009M5NX.jpg0683p000009M5W0.jpg0683p000009M5go.jpg0683p000009M5gt.jpg0683p000009M5g0.jpg

 

Thanks and Regards,

Subhadip

Anonymous
Not applicable
Author

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 0683p000009MACn.png