I am having issues with Drupal's Aggregator reading Atom 1.0 feeds that are generated by ROME (https://rome.dev.java.net/). For example, the contents of the <dc:date> container are added as plaintext to the summary.

I have had a look at modules/aggregator/aggregator.parser.inc from Drupal CVS and was able to locate a few issues.

Firstly, aggregator_element_end() misses the line "$name = strtolower($name);". The way it is now, it will actually never detect a closing tag.

Now, if for example a <summary> element ends, it is not detected at all (even with the strtolower fix), so all subsequent element bodies are added to the summary until the next closing </entry> is reached. Since ROME writes a <dc:date> after <summary>, the date is added to the bottom of the summary text. I fixed the parser by adding these lines to aggregator_element_end()'s switch block:

   case 'summary':
      $element = 'item';
      break;

Anyhow this is just a quick hack. I suggest to use a stack for $element, so it is always possible just to pop the last entry when an element is closed.

Finally, Atom uses <id> instead of <guid> for a permanent reference id. Anyhow the <id> tag is ignored by the current code, so the aggregator already assumes a new entry when just the title was changed. I tried to fix it by replacing the line

     $item['guid'] = isset($item['guid']) ? $item['guid'] : '';

by

     $item['guid'] = isset($item['guid']) ? $item['guid'] : (isset($item['id']) ? $item['id'] : '');

I would offer more help or patches, but I am out of practice with PHP, and too much involved in other projects.

An example Atom 1.0 feed generated by ROME can be found here: http://www.shredzone.de/cilla/feed/category/2/Linux.xml