Subject: extracting authors and contributors from the format

From: Eric Scheid <[email-masked]>
Date: Sun, 22 May 2005 05:18:45 +1000

Here's an abbreviated feed:

<feed>
    <entry>
        <author><name>Raggett, D, Hors, A, and I Jacobs</name></author>
        <contributor><name>Dave Raggett</name></contributor>
        <contributor><name>Arnaud Le Hors</name></contributor>
        <contributor><name>Ian Jacobs</name></contributor>
    </entry>
    <entry>
        <author><name>Homer Simpson</name></author>
        <contributor><name>Marge Simpson</name></contributor>
    </entry>
    <entry>
        <author><name>Barney Rubble, Esq</name></author>
    </entry>
    <entry>
        <author><name>Simpson, H J, and D Raggett</name></author>
        <contributor><name>Dave Raggett</name></contributor>
        <contributor><name>Homer Simpson</name></contributor>
    </entry>
    <entry>
        <author><name>Raggett, D, and H J Simpson</name></author>
        <contributor><name>Dave Raggett</name></contributor>
        <contributor><name>Homer Simpson</name></contributor>
    </entry>
</feed>

The very real task I have is to produce an A-Z index of authors.

Is this right:

    Arnaud Le Hors
    Barney Rubble, Esq
    Dave Raggett
    Dave Raggett
    Dave Raggett
    Homer Simpson
    Homer Simpson
    Homer Simpson
    Ian Jacobs
    Marge Simpson
    Raggett, D, and H J Simpson
    Raggett, D, Hors, A, and I Jacobs
    Simpson, H J, and D Raggett

maybe this is better:

    Arnaud Le Hors
    Barney Rubble, Esq
    Dave Raggett
    Homer Simpson
    Ian Jacobs
    Marge Simpson
    Raggett, D, and H J Simpson
    Raggett, D, Hors, A, and I Jacobs
    Simpson, H J, and D Raggett

getting closer:

    Arnaud Le Hors
    Barney Rubble, Esq
    Dave Raggett
    Homer Simpson
    Ian Jacobs
    Marge Simpson

finally, is this it:

    Arnaud Le Hors
    Barney Rubble, Esq
    Dave Raggett
    Homer Simpson
    Ian Jacobs

The first list is obviously wrong, and so is the second, and the third list
is also wrong (Marge Simpson is a contributor, not an author ... or in the
words of the format-08 spec, Marge "contributed to an entry", but was not
indicated to be an "author of" that entry).

The last list looks correct, right?

But there's a problem. Can you spot it?

e.