Query with sorting

List the titles and years of all books published by Addison-Wesley after 1991, in alphabetic order.

<bib>
 {
   for $b in document("bib.xml")//book
    [publisher = "Addison-Wesley" and @year > "1991"]
   order by (title)
   return
    <book>
     { $b/@year } { $b/title }
    </book> 
 }
</bib>

June 2002 version of QuiP does not yet handle this one.

Adapted from XML Query Use Cases


Previous | Next | Top | Cafe con Leche

Copyright 2002, 2003 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 16, 2003