Some .... in .... satisfies

Hello

I searched and looked on Tamino’s XQuery Functions, but I didn’t found
anything yet, how to solve a xquery with a functionality like
"Some … in … satisfies "

Have anybody an idea how to solve ?

For example this:
“List the reserves of those open auctions where a
certain person issued a bid before another person.”

let $auction := doc("auction.xml") return
for $b in $auction/site/open_auctions/open_auction
where
  some $pr1 in $b/bidder/personref[@person = "person20"],
       $pr2 in $b/bidder/personref[@person = "person51"]
  satisfies $pr1 << $pr2
return <history>{$b/reserve/text()}</history>

How can I check the order of two elements of a sequence , so that I know which one ($b/bidder/personref[@person = “person20”]
or $b/bidder/personref[@person = “person51”] )is the first ?

Hi,

iin general, you do not need “some satisfies”
Your query can be expressed as follows:


let $auction := input()/auction 
for $b in $auction/site/open_auctions/open_auction
for $pr1 in $b/bidder/personref[@person = "person20"],      
  $pr2 in $b/bidder/personref[@person = "person51"]   
 where   $pr1 << $pr2 return $b/reserve/text()

Regards

Harald