[XML4Lib] Alphabetical Listing

Engard, Nicole nicole.engard at ptsem.edu
Fri Oct 19 09:28:23 EDT 2007

Hi all,


Just wondering if anyone has written an Xquery that will split a list up
alphabetically.  In particular a list of authors/titles.  I want to put
an A-Z list of links at the top of the page so people can see just the
authors with names starting with B if they way - and so on.  I figured
why re-invent the wheel if someone else has done it already :-)


This is my list:


define function display-authorlist($params as node()) as node() {

  (: Display introductory text :)
    <h1>Alphabetical Listing of Authors</h1> 
    (: Search creators and include total contributions :)
    for $creators in fn:distinct-values(
      for $creator in fn:collection()//dc:creator
      let $uniformName
      order by fn:tokenize($uniformName, " ")[fn:last()]
      return $uniformName) 
:creator[cts:contains(., $creators)])
    where $count != 0
    return <li><a href="default.xqy?terms={$creators}">{$creators}</a>


It's a bit insane right now without having some sort of division.



Nicole C. Engard

Metadata Librarian


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webjunction.org/wjlists/xml4lib/attachments/20071019/a63289c7/attachment.htm

More information about the XML4Lib mailing list