Query with multiple variables

Create a list of all the title-author pairs, with each pair enclosed in a result element.

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

Adapted from XML Query Use Cases


Previous | Next | Top | Cafe con Leche | Cafe au Lait

Copyright 2002-2008 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified January 18, 2004