Anonymous
Not applicable
2010-11-18
06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
244 Views