Code Listing 1: Book price query and result

<books-with-prices>
 {
  for $b in document("http://www.bn.com/bib.xml")//book,
    $a in document("http://www.amazon.com/reviews.xml")//entry

  where $b/title = $a/title
  return
   <book-with-prices>
    { $b/title }
    <price-amazon>{ $a/price/text() }</price-amazon>
    <price-bn>{ $b/price/text() }</price-bn>

   </book-with-prices>
 }
</books-with-prices>

Executing this query returns a result like this:

<books-with-prices>

  <book-with-prices>
    <title>TCP/IP Illustrated</title>
    <price-amazon>65.95</price-amazon>
    <price-bn>65.95</price-bn>
  </book-with-prices>
  <book-with-prices>
    <title>Advanced Programming in the Unix environment</title>
    <price-amazon>65.95</price-amazon>

    <price-bn>65.95</price-bn>
  </book-with-prices>
  <book-with-prices>
    <title>Data on the Web</title>
    <price-amazon>34.95</price-amazon>
    <price-bn>39.95</price-bn>
  </book-with-prices>
</books-with-prices>


Oracle Is The Information Company About Oracle | Oracle RSS Feeds | Careers | Contact Us | Site Maps | Legal Notices | Terms of Use | Privacy