Nested Queries

For each book in the bibliography, list the title and authors, grouped inside a result element.

<results>
 {
   for $b in document("bib.xml")/bib/book
   return
    <result>
     { $b/title }
     {  
       for $a in $b/author
       return $a
     }
    </result>
 }
</results>

Adapted from XML Query Use Cases


Previous | Next | Top | Cafe con Leche

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