You are here

function aggregator_element_start in Drupal 4

Same name and namespace in other branches
  1. 5 modules/aggregator/aggregator.module \aggregator_element_start()
  2. 6 modules/aggregator/aggregator.module \aggregator_element_start()
  3. 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.module

File

modules/aggregator.module, line 586
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 ($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;
}