aggregator_element_start

  1. drupal
    1. 5 aggregator.module
    2. 6 aggregator.module
    3. 7
    4. 8
Versions
5 – 7 aggregator_element_start($parser, $name, $attributes)

Callback function used by the XML parser.

Code

modules/aggregator/aggregator.parser.inc, line 176

<?php
function aggregator_element_start($parser, $name, $attributes) {
  global $item, $element, $tag, $items, $channel;

  $name = strtolower($name);
  switch ($name) {
    case 'image':
    case 'textinput':
    case 'summary':
    case 'tagline':
    case 'subtitle':
    case 'logo':
    case 'info':
      $element = $name;
      break;
    case 'id':
    case 'content':
      if ($element != 'item') {
        $element = $name;
      }
    case 'link':
      // According to RFC 4287, link elements in Atom feeds without a 'rel'
      // attribute should be interpreted as though the relation type is
      // "alternate".
      if (!empty($attributes['HREF']) && (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;
}
?>