{
document("bib.xml")/bibliography/book[@price>20]
}
{
document("bib.xml")/bibliography/book[float(@price)>20]
}
{
for $b in document("bib.xml")/bibliography/book
let $p := $b/publisher
where $b/year < 2000
return
{ $b/title }
{ $p }
}
{
for $b in document("bib.xml")/bibliography/book[year < 2000]
return
{ $b/title }
{ $b/publisher }
}
{
for $b in document("bib.xml")/bibliography/book,
$p in $b/publisher
where $b/year < 2000
return
{ $b/title }
{ $p }
}
{
let $b := document("bib.xml")/bibliography/book
where $b/year < 2000
return
{ $b/title }
{ $b/publisher }
}
{
for $b in document("bib.xml")/bibliography/book
return
{
for $a in $b/author
return {string($a)}
}
}
{
for $b1 in document("bib.xml")//book
for $b2 in document("bib.xml")//book
where $b1/author = $b2/author
return
{$b1/title}
{$b2/title}
}
{
for $b in document("bib.xml")//book
where (some $section in $b//section satisfies contains (string($section), "XML"))
return $b
}
{
for $b in document("bib.xml")//book
where (every $section in $b//section satisfies contains (string($section), "XML"))
return $b
}
{
for $pub in distinct-values(document("bib.xml")//publisher)
let $price :=
avg(float(document("bib.xml")//book[publisher=$pub]/@price))
return
{$pub}
{$price}
}