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"]
   RETURN
    <book>
     { $b/@year } { $b/title }
    </book> SORTBY (title)
 }
</bib>

Adapted from XML Query Use Cases


Previous | Next | Top | Cafe con Leche

Copyright 2002 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified September 13, 2001