function aggregator_element_start
7.x aggregator.parser.inc | aggregator_element_start($parser, $name, $attributes) |
6.x aggregator.module | aggregator_element_start($parser, $name, $attributes) |
Call-back function used by the XML parser.
1 string reference to 'aggregator_element_start'
- aggregator_parse_feed in drupal-6.x/
modules/ aggregator/ aggregator.module - Parse a feed and store its items.
File
- drupal-6.x/
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;
}