function aggregator_element_start in Drupal 6
Same name and namespace in other branches
- 4 modules/aggregator.module \aggregator_element_start()
- 5 modules/aggregator/aggregator.module \aggregator_element_start()
- 7 modules/aggregator/aggregator.parser.inc \aggregator_element_start()
Call-back function used by the XML parser.
1 string reference to 'aggregator_element_start'
- aggregator_parse_feed in modules/
aggregator/ aggregator.module - Parse a feed and store its items.
File
- modules/
aggregator/ aggregator.module, line 467 - Used to aggregate syndicated content (RSS, RDF, and Atom).
Code
function aggregator_element_start($parser, $name, $attributes) {
global $item, $element, $tag, $items, $channel;
switch ($name) {
case 'IMAGE':
case 'TEXTINPUT':
case 'CONTENT':
case 'SUMMARY':
case 'TAGLINE':
case 'SUBTITLE':
case 'LOGO':
case 'INFO':
$element = $name;
break;
case 'ID':
if ($element != 'ITEM') {
$element = $name;
}
case 'LINK':
if (!empty($attributes['REL']) && $attributes['REL'] == 'alternate') {
if ($element == 'ITEM') {
$items[$item]['LINK'] = $attributes['HREF'];
}
else {
$channel['LINK'] = $attributes['HREF'];
}
}
break;
case 'ITEM':
$element = $name;
$item += 1;
break;
case 'ENTRY':
$element = 'ITEM';
$item += 1;
break;
}
$tag = $name;
}