TeleFlow Forums
http://teleflow.org/phpbb/

XML: Is there a required format?
http://teleflow.org/phpbb/viewtopic.php?f=10&t=506
Page 1 of 1

Author:  susan.burkley [ Wed Mar 26, 2008 9:29 am ]
Post subject:  XML: Is there a required format?

We need to be able to pull scheduled outbound call data from the client and into your system via and XML document. Does TeleFlow care about the format of the file? Are there any needed elements that should be included? I couldn’t find a sample doc to reference, but it would help us to know some of the ‘gotchas’ and needed structures before we start slogging through things. Is there a sample available for us to reference?

Thanks in advance,
Susan Burkley

Author:  Chris [ Wed Mar 26, 2008 3:00 pm ]
Post subject:  Re: XML: Is there a required format?

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 755 times

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/