function aggregator_element_data in Drupal 6
Same name and namespace in other branches
- 4 modules/aggregator.module \aggregator_element_data()
- 5 modules/aggregator/aggregator.module \aggregator_element_data()
- 7 modules/aggregator/aggregator.parser.inc \aggregator_element_data()
Call-back function used by the XML parser.
1 string reference to 'aggregator_element_data'
- aggregator_parse_feed in modules/
aggregator/ aggregator.module - Parse a feed and store its items.
File
- modules/
aggregator/ aggregator.module, line 533 - Used to aggregate syndicated content (RSS, RDF, and Atom).
Code
function aggregator_element_data($parser, $data) {
global $channel, $element, $items, $item, $image, $tag;
$items += array(
$item => array(),
);
switch ($element) {
case 'ITEM':
$items[$item] += array(
$tag => '',
);
$items[$item][$tag] .= $data;
break;
case 'IMAGE':
case 'LOGO':
$image += array(
$tag => '',
);
$image[$tag] .= $data;
break;
case 'LINK':
if ($data) {
$items[$item] += array(
$tag => '',
);
$items[$item][$tag] .= $data;
}
break;
case 'CONTENT':
$items[$item] += array(
'CONTENT' => '',
);
$items[$item]['CONTENT'] .= $data;
break;
case 'SUMMARY':
$items[$item] += array(
'SUMMARY' => '',
);
$items[$item]['SUMMARY'] .= $data;
break;
case 'TAGLINE':
case 'SUBTITLE':
$channel += array(
'DESCRIPTION' => '',
);
$channel['DESCRIPTION'] .= $data;
break;
case 'INFO':
case 'ID':
case 'TEXTINPUT':
// The sub-element is not supported. However, we must recognize
// it or its contents will end up in the item array.
break;
default:
$channel += array(
$tag => '',
);
$channel[$tag] .= $data;
}
}