Commit 4cb1e23b authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-01-05 16:49:57 by cmiachon] Empty log message

Original author: cmiachon
Date: 2004-01-05 16:49:57+00:00
parent e4137992
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.
Solution in XQuery:
for $b in doc("")//book[author]
{ $b/title }
{ $b/author }
for $b in doc("")//book[editor]
{ $b/title }
include "tests/cql/" ;;
include "tests/cql/";;
(* in CQLx *)
select <book>(([b]/Title) @ ([b]/Author))
from b in [doc]/<book>[_ Author;_])
(select <reference>(([b]/Title) @ ([b]/Editor/Affiliation))
from b in [doc]/<book>[_ Editor;_]
(* in CQLp *)
select <book>([t] @ la)
from <bib>[b::Book+] in [doc],
<book>[t&Title la::Author+ ;_] in b
select <reference>([t] @ [aff])
from <bib>[b::Book+] in [doc],
<book>[t&Title _* <editor>[_* aff&Affiliation] ;_] in b
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