Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Anonymous
Not applicable

tFileInputXML read a multi level XML file

hello
I need to read a complex XML file.
like this one for instance :
<root>
<products>
<product>
<name> n</name>
<price> 0 </price>
<descriptions>
<desc>
<name>blablabla </name>
<sub_desc>
<name>name</name>
<value>val</value>
</sub_desc>
<sub_desc>
<name>name</name>
<value>val</value>
</sub_desc>
<sub_desc>
...
</sub_desc>
</desc>
<desc> ...</desc>
...
</descriptions>

</product>
<product>
...
</product>
...
</products>
</root>

to read this file, I use first a tFileInput XML, that select a complete product block in a string, the checkbox "with nodes" is selected.
then i get the first level in a tExtractXMLField, and a string "descriptions" that contains all the block <descriptions>. then I read this in a tExtractXMLField, etc etc.

Is it the good way to read a multiple level XML file ?

In my example, I need to insert the data from the XML file into a mysql database with stored procedures.
As I have no output flow from a stored proc, I use a tmap to recover the values sent in input of the sp. I made a screenshot, because it's not easy to explain !

Thank you for your advises.
Labels (4)