Query that joins two documents

For each book found in both bib.xml and reviews.xml, list the title of the book and its price from each source.

   for $b in doc("bib.xml")//book,
     $a in doc("reviews.xml")//entry
   where $b/title = $a/title
     { $b/title },
       <price-amazon> { $a/price/text() } </price-amazon>
       <price-bn> { $b/price/text() } </price-bn>

Adapted from XML Query Use Cases

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

Copyright 2002-2005 Elliotte Rusty Harold
Last Modified September 13, 2001