[XQuery]

Hi.
XQuery 1.0: An XML Query Language (
http://www.w3.org/TR/2007/REC-xquery-20070123/),
appendice J1 Joins.
I guess the second example XQuery (line 10):

for $s in fn:doc("suppliers.xml")/suppliers/supplier
order by $s/suppname
return
   <supplier>
      {
        $s/suppname,
        for $i in fn:doc("catalog.xml")/items/item
                 [suppno = $s/suppno],
            $p in fn:doc("parts.xml")/parts/part
                * [partno = $i/pno]*
        order by $p/description
        return $p/description
      }
   </supplier>

should be:

for $s in fn:doc("suppliers.xml")/suppliers/supplier
order by $s/suppname
return
   <supplier>
      {
        $s/suppname,
        for $i in fn:doc("catalog.xml")/items/item
                 [suppno = $s/suppno],
            $p in fn:doc("parts.xml")/parts/part
                * [partno = $i/partno]*
        order by $p/description
        return $p/description
      }
   </supplier>

All the best,
Gennady Berman.

Received on Wednesday, 10 November 2010 22:48:26 UTC