If you are getting multiple pieces of repeat data from an XML document and pulling them into TeleFlow variables, you will find it easier if you depend more on element attributes than on the values of individual data elements (see example, below).
I didn't have a quick and simple demo of what I would suggest you run with on-hand, so I put something basic together, and have attached a small application that shows how to get at the attributes of a file (sample.xml) with the following contents:
Code:
<?xml version="1.0"?>
<call_list>
<call_to start_time="10:00:00" end_time="12:00:00" name="Alice Smith" phone="5555551234"></call_to>
<call_to start_time="12:00:00" end_time="17:30:00" phone="5555554321" name="John Smith" ></call_to>
</call_list>
To see what the steps are doing (since the application doesn't do much of anything), you will want to run it in TeleFlow Simulator, "call in", and then let it run until it hangs up. Then, if you look at the log output, you will see the variables being set as it fetches the attributes of the repeating call_to node.
As for XML file structure/layout:
- The order of the attributes for an element doesn't matter.
- There is currently a known problem with trying to get the attributes or a value for the root element (in the example file, this would be <call_list>), so be sure you have a structure where you can avoid this altogether.
If you extract the following attached zip file, you should be able to run XML_Demo.tap:
Attachment:
XML_Demo.zip [34.36 KB]
Downloaded 986 times