Commit ab17ed27 authored by Giuseppe Castagna's avatar Giuseppe Castagna

updated examples

parent 737d3229
......@@ -1446,27 +1446,8 @@ debug compile [A+|B+] [A+] [B+]
fun ([A+|B+] -> Int) [ <a>_ ; _ ] -> 0 | _ -> 1
*)
"; ]
let present = "<ul><li><a href=\"/cgi-bin/cduce?example=q1\">Q1.</a>
Q1 Query
</li><li><a href=\"/cgi-bin/cduce?example=q2\">Q2.</a>
Q2 Query
</li><li><a href=\"/cgi-bin/cduce?example=q3\">Q3.</a>
Q3 Query
</li><li><a href=\"/cgi-bin/cduce?example=q4\">Q4.</a>
Q4 Query
</li><li><a href=\"/cgi-bin/cduce?example=q5\">Q5.</a>
Q5 Query
</li><li><a href=\"/cgi-bin/cduce?example=q6\">Q6.</a>
Q6 Query
</li><li><a href=\"/cgi-bin/cduce?example=q8\">Q8.</a>
Q8 Query
</li><li><a href=\"/cgi-bin/cduce?example=q9\">Q9.</a>
Q9 Query
</li><li><a href=\"/cgi-bin/cduce?example=q11\">Q11.</a>
Q11 Query
</li><li><a href=\"/cgi-bin/cduce?example=q12\">Q12.</a>
Q12 Query
</li><li><a href=\"/cgi-bin/cduce?example=qatt1\">Attributes and elements.</a>
let present = "<ul>
<li><a href=\"/cgi-bin/cduce?example=qatt1\">Attributes and elements.</a>
Part 1
</li><li><a href=\"/cgi-bin/cduce?example=qatt2\">Attributes and elements.</a>
Part 2
......@@ -1501,4 +1482,31 @@ Mutable values.
</li><li><a href=\"/cgi-bin/cduce?example=pm_compil\">Compilation of pattern matching.</a>
This example demonstrates the efficient compilation of pattern
matching.
</li></ul>"
\ No newline at end of file
</li><li><a href=\"/cgi-bin/cduce?example=q1\">Q1.</a>
Q1 Query: List books published by Addison-Wesley after 1991, including their year and title.
</li><li><a href=\"/cgi-bin/cduce?example=q2\">Q2.</a>
Q2 Query: Create a flat list of all the title-author pairs, with each pair enclosed in a \"result\" element.
</li><li><a href=\"/cgi-bin/cduce?example=q3\">Q3.</a>
Q3 Query: For each book in the bibliography, list the title and authors, grouped inside a \"result\" element.
</li><li><a href=\"/cgi-bin/cduce?example=q4\">Q4.</a>
Q4 Query: For each author in the bibliography, list the author`s name and the titles
of all books by that author, grouped inside a \"result\" element.
</li><li><a href=\"/cgi-bin/cduce?example=q5\">Q5.</a>
Q5 Query: For each book found at both bstore1.example.com and bstore2.example.com,
list the title of the book and its price from each source.
</li><li><a href=\"/cgi-bin/cduce?example=q6\">Q6.</a>
Q6 Query: For each book that has at least one author, list the title and first two authors,
and an empty \"et-al\" element if the book has additional authors.
</li><li><a href=\"/cgi-bin/cduce?example=q8\">Q8.</a>
Q8 Query: Find books in which the name of some element ends with the string \"or\"
and the same element contains the string \"Suciu\" somewhere in its content.
For each such book, return the title and the qualifying element.
</li><li><a href=\"/cgi-bin/cduce?example=q9\">Q9.</a>
Q9 Query: In the document \"books.xml\", find all section or chapter titles that
contain the word \"XML\", regardless of the level of nesting.
</li><li><a href=\"/cgi-bin/cduce?example=q11\">Q11.</a>
Q11 Query: For each book with an author, return the book with its title and authors.
For each book with an editor, return a reference with the book title and the editor`s affiliation.
</li><li><a href=\"/cgi-bin/cduce?example=q12\">Q12.</a>
Q12 Query: Find pairs of books that have different titles but the same set of authors (possibly in a different order).
</li></ul>"
<?xml version="1.0" encoding="UTF-8"?>
<examples>
<example code="q1" title="Q1">
Q1 Query
</example>
<example code="q2" title="Q2">
Q2 Query
</example>
<example code="q3" title="Q3">
Q3 Query
</example>
<example code="q4" title="Q4">
Q4 Query
</example>
<example code="q5" title="Q5">
Q5 Query
</example>
<example code="q6" title="Q6">
Q6 Query
</example>
<example code="q8" title="Q8">
Q8 Query
</example>
<example code="q9" title="Q9">
Q9 Query
</example>
<example code="q11" title="Q11">
Q11 Query
</example>
<example code="q12" title="Q12">
Q12 Query
</example>
<example code="qatt1" title="Attributes and elements">
Part 1
......@@ -112,6 +72,53 @@ This example demonstrates the efficient compilation of pattern
matching.
</example>
<example code="q1" title="Q1">
Q1 Query: List books published by Addison-Wesley after 1991, including their year and title.
</example>
<example code="q2" title="Q2">
Q2 Query: Create a flat list of all the title-author pairs, with each pair enclosed in a \"result\" element.
</example>
<example code="q3" title="Q3">
Q3 Query: For each book in the bibliography, list the title and authors, grouped inside a \"result\" element.
</example>
<example code="q4" title="Q4">
Q4 Query: For each author in the bibliography, list the author`s name and the titles
of all books by that author, grouped inside a \"result\" element.
</example>
<example code="q5" title="Q5">
Q5 Query: For each book found at both bstore1.example.com and bstore2.example.com,
list the title of the book and its price from each source.
</example>
<example code="q6" title="Q6">
Q6 Query: For each book that has at least one author, list the title and first two authors,
and an empty \"et-al\" element if the book has additional authors.
</example>
<example code="q8" title="Q8">
Q8 Query: Find books in which the name of some element ends with the string \"or\"
and the same element contains the string \"Suciu\" somewhere in its content.
For each such book, return the title and the qualifying element.
</example>
<example code="q9" title="Q9">
Q9 Query: In the document \"books.xml\", find all section or chapter titles that
contain the word \"XML\", regardless of the level of nesting.
</example>
<example code="q11" title="Q11">
Q11 Query: For each book with an author, return the book with its title and authors.
For each book with an editor, return a reference with the book title and the editor`s affiliation.
</example>
<example code="q12" title="Q12">
Q12 Query: Find pairs of books that have different titles but the same set of authors (possibly in a different order).
</example>
</examples>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment