Hi,
To perform a value-based duplicate elimination you have to apply the distinct-values() function. For your example I would suggest the following query:
for $dt in input()/book/title
for $dp in input()/book/price
let $g := input()/book[title =$dt and price = $dp]
where $g
return
{$dt, $dp}
The two “for” clauses retrieve all distinct book titles and prices. The result is a cross-product over the two distinct value sets. The “let” clause retrieves for each combination of “title” and “price” the according “book” elements. By referencing the variable $g in the “where” clause you perform a none-empty check on the node set determined by the “let” clause. Hence, you create a “BookInformation” element just for the existing combinations of “title” and “price”.
Best regards,
Thorsten Fiebig
#Tamino#webMethods#API-Management