@@ -295,13 +295,83 @@ optimiser automatically translates the latter into a pure pattern one
</p>
</section>
<sectiontitle="Joins">
<p>
TO BE DONE
This example is the exact transcription of query Q5 of XQuery use cases.
We first give the corresponding CDuce types. We leave the user in charge of creating the corresponding relevant values.
</p>
<sample><![CDATA[
type Bib = <bib>[Book*]
type Book = <bookyear=String>[Title (Author+ | Editor+ ) Publisher Price]
type Author = <author>[Last First]
type Editor = <editor>[Last First Affiliation]
type Title = <title>[PCDATA]
type Last = <last>[PCDATA]
type First = <first>[PCDATA]
type Affiliation = <affiliation>[PCDATA]
type Publisher = <publisher>[PCDATA]
type Price = <price>[PCDATA]
]]>
</sample>
<p>
The queries are expressed first in an XQuery-like style, then in a pure pattern style: the first pattern-based query is the one produced by the automatic translation from the first one. The last query correponds to a pattern aware programmer's version.
</p>
<p>
XQuery style
</p>
<sample><![CDATA[
<books-with-prices>
select <book-with-price>[t1
<price-amazon>([p2]/_) <price-bn>([p1]/_)]
from b in [biblio]/Book ,
t1 in [b]/Title,
e in [amazon]/Entry,
t2 in [e]/Title,
p2 in [e]/Price,
p1 in [b]/Price
where t1=t2
]]>
</sample>
<p> Automatic translation of the previous query into a pure pattern (thus more efficient) one </p>