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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

converting XML to JSON with multiple loop elements

Hi All,
I need to convert a big XML with multiple loop elements in to JSON, please suggest me how to achieve it.
Currently I am able to convert simple XML to JSON with below design
tFileInputXML--main--tWriteJsonField--main-->tFileOutputDelimited
Please help me to understand how to achieve multiple loop elements.

example:
<student>
<name>john</name>
<class>8</class>
<age>12</age>
<subject>
<subject_name>Physics</subject_name>
<score>80</score>
<grade>B</grade>
<percentage>75%</percentage>
</subject>
<subject>
<subject_name>Chemistry</subject_name>
<score>85</score>
<grade>B</grade>
<percentage>82%</percentage>
</subject>
<address_details>
<address>
<address_type>Temp Address</address_type>
<address_1>main</address_1>
<address_2>India</address_2>
<address_3>Delhi</address_3>
</address>
<address>
<address_type>Permanent Address</address_type>
<address_1>main</address_1>
<address_2>USA</address_2>
<address_3>Newyork</address_3>
</address>
</address_details>
</student>
Labels (4)
2 Replies
Anonymous
Not applicable
Author

Hi
There are multiple loop elements (subject and address) in the source XML file, it is able to extract the data from all loop elements with tFileInputMSXML component, but it is impossible to create multiple loop elements with tWriteJsonField component. Right now, you can only generate a json file for each loop element.
Shong
jiteshvirwani
Contributor
Contributor

can we create a JSON with multiple loop in twritejson component in Talend open studio big data