[XML-SIG] XSLT sorting by "authors" element, with multiple authors

Jon Berry jberry@sandia.gov
Mon, 12 May 2003 16:33:58 -0600


The XSLT sorting articles I've seen on the web
don't address the issue of sorting citations by
"authors," where the latter is a group of authors
(not the single authors typical of web examples).

For example:

<article>
        <title>    "An Article"
        </title>
        <authors>
              <person lastname = "Smith"/>
              <person lastname = "Doe"/>
         </authors>
</article>

...

I'd like to sort by the last name, alphabetically by
first differing author.  So the algorithm would be:
    * within each article, sort authors by lastname
    * to compare Article A with Article B:
              * Look at last names of first author (if different, 
comparison done)
              * else if first authors are the same, look at second authors,
              * etc.
              * if not distinguished, go on to next sorting key (say 
'title')

Noting of course that we might be comparing articles with
different numbers of authors.  

In initial searches, it looked like the   xsl:for-each-group
and/or xsl:function constructs might help, but they don't seem
to be supported by the current PyXML/4Suite implementations.

So, with the constraint that I'm trying to avoid buying a book for now,
is this doable using templates, easy, and currently implementable
with free software?

thanks,
Jon Berry