GOAL
books-with-prices [
all book-with-prices [
title [ var T ],
price-a [ var Pa ],
price-b [ var Pb ]
]
]
FROM
and {
in {
resource {"file:bib.xml"},
bib {{
book {{
title { var T },
price { var Pa }
}}
}}
},
in {
resource {"file:reviews.xml"},
reviews {{
entry {{
title { var T },
price { var Pb }
}}
}}
}
}
END
As you can see in this example, several different query terms may be connected by wraping them in an and element (specifying that both queries have to succeed with these variables). The other available connection is or (denoting that at least one of the queries has to succeed).
Note that since variables in Xcerpt are like variables in logic, the and-connection together with the multiple occurences of the variable T represents the equivalent of an equi-join in relational databases, such that each combination of the variables T, Pa and Pb is always "valid" as expected.