I need to parse this xml feed. I can parse out the <event_datetimeGMT>, <sporttype> and <league> tags just fine but I cant figure out how to parse out the information in the two different <participant_name> tags if eacg event. Does anyone know how I would do this? Below is a sample of the xml and my end handler function. Any help would be great!
# END HANDLER FUNCTION
function EndHandler(&$Parser, &$Elem) {
global $Data, $CData, $XmlEntities;
$Data[$Elem] = strtr( trim( implode('', $CData) ), $XmlEntities);
switch ($Elem) {
case 'EVENT':
echo "{$Data['LEAGUE']}";
break;
}
}
<event_list>
<event>
<event_datetimeGMT>20040218 19:05</event_datetimeGMT>
<sporttype>Basketball</sporttype>
<league>NBA Basketball</league>
<participant>
<participant_name>San Antonio Spurs</participant_name>
<visiting_home_draw>Visiting</visiting_home_draw>
</participant>
<participant>
<participant_name>Toronto Raptors</participant_name>
<visiting_home_draw>Home</visiting_home_draw>
</participant>
</event>
<event>
<event_datetimeGMT>20040218 19:05</event_datetimeGMT>
<sporttype>Basketball</sporttype>
<league>NBA Basketball</league>
<participant>
<participant_name>Dallas Mavericks</participant_name>
<visiting_home_draw>Visiting</visiting_home_draw>
</participant>
<participant>
<participant_name>Cleveland Cavaliers</participant_name>
<visiting_home_draw>Home</visiting_home_draw>
</participant>
</event>
</event_list>
[code=php]