10-30-2009, 02:32 AM
I want to parse an XML file that has 10 entries. Each entry contains 8 pieces of data.
I'm thinking multidimensional array is the way to do this?
So here is an example of the XML:
So I would like to grab specifics about the XML data...for example Array[10 6] would equal "21:34:54"
Here's how I'm grabbing the data from the XML...just need to know how to populate the array!
Function InterGen_XML_Multi_Parser
I'm thinking multidimensional array is the way to do this?
So here is an example of the XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<nexgen_audio_export>
<audio ID="id_3844367666_30038279">
<type>Liner</type>
<status>None</status>
<title>(F) AM1220 - airy 1</title>
<length>00:00:04.540</length>
<played_time>21:22:57</played_time>
<number>-1</number>
<cut>-1</cut>
<millisec_to_start>64</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3844523916_30038279">
<type>Bed</type>
<status>None</status>
<title>WLPO NEWS SOUNDER/auto</title>
<length>00:00:42.630</length>
<played_time>21:29:50</played_time>
<number>800149</number>
<cut>1</cut>
<millisec_to_start>412236</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3844680166_30038279">
<type>News</type>
<status>None</status>
<title>WLPO NEWS NIGHT/OVERNIGHT (1:20 max)</title>
<length>00:01:12.090</length>
<played_time>21:29:59</played_time>
<number>700985</number>
<cut>10</cut>
<millisec_to_start>421300</millisec_to_start>
<co_op>Allstate</co_op>
</audio>
<audio ID="id_3844836416_30038279">
<type>Promo</type>
<status>None</status>
<title>WLPO CONTEST RULES</title>
<length>00:01:00.630</length>
<played_time>21:31:08</played_time>
<number>530001</number>
<cut>1</cut>
<millisec_to_start>491117</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3844992666_30038279">
<type>Spot</type>
<status>None</status>
<title>River Valley WX/ irn-hpm-midwestcntr-60</title>
<length>00:00:59.140</length>
<played_time>21:32:07</played_time>
<number>52615</number>
<cut>1</cut>
<millisec_to_start>549751</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3845148916_30038279">
<type>Spot</type>
<status>None</status>
<title>FARM SAFETY WEEK fall -1</title>
<length>00:00:29.162</length>
<played_time>21:33:04</played_time>
<number>936100</number>
<cut>1</cut>
<millisec_to_start>606762</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3845305166_30038279">
<type>Spot</type>
<status>None</status>
<title>Tag Cart for Farm Safety</title>
<length>00:00:22.491</length>
<played_time>21:33:32</played_time>
<number>936101</number>
<cut>2</cut>
<millisec_to_start>634864</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3845461416_30038279">
<type>Fill</type>
<status>None</status>
<title>Radio Heard Here poetry in motion</title>
<length>00:00:32.590</length>
<played_time>21:33:54</played_time>
<number>500164</number>
<cut>3</cut>
<millisec_to_start>656635</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3845617666_30038279">
<type>Fill</type>
<status>None</status>
<title>WLPO AM PROJECT SANTA</title>
<length>00:00:29.780</length>
<played_time>21:34:25</played_time>
<number>500185</number>
<cut>1</cut>
<millisec_to_start>688025</millisec_to_start>
<co_op></co_op>
</audio>
<audio ID="id_3845773916_30038279">
<type>Liner</type>
<status>None</status>
<title>(G) AM1220 - pointless questions (RB)</title>
<length>00:00:07.780</length>
<played_time>21:34:54</played_time>
<number>-1</number>
<cut>-1</cut>
<millisec_to_start>716676</millisec_to_start>
<co_op></co_op>
</audio>
</nexgen_audio_export>
So I would like to grab specifics about the XML data...for example Array[10 6] would equal "21:34:54"
Here's how I'm grabbing the data from the XML...just need to know how to populate the array!
Function InterGen_XML_Multi_Parser
function str'XMLfile
;RunCode
str XML.getfile(XMLfile)
IXml x=CreateXml
;GetXML
x.FromString(XML);err goto GetXML
ARRAY(IXmlNode) aw
x.Path("nexgen_audio_export/audio" aw)
int i=aw.len
for _i 0 i
,str Type=aw[_i].ChildValue("type")
,str Status=aw[_i].ChildValue("status")
,str Title=aw[_i].ChildValue("title")
,str Co_op=aw[_i].ChildValue("co_op")
,str Length=aw[_i].ChildValue("length")
,str Number=aw[_i].ChildValue("number")
,str Cut=aw[_i].ChildValue("cut")
,str Played_time=aw[_i].ChildValue("played_time")