473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

XQuery : Some .... in .... satisfies

Hello

Have anybody an idea how to solve "Some ... in ... satisfies " with
standard functions ?
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>
Thats an query of the XMark Benchmark... Q4.
I need it to execute on Tamino, and so I have to rewrite it, because
Tamino doesn't support
"Some ... in .... satisfies".

Sep 4 '06 #1
6 3160
Been a while since I've worked with XQuery, but in XSLT I'd rephrase
that as "find all which satisfy; is that nodeset empty". In XSLT any
comparison expression on nodesets is taken as "does any element
satisfy"; I'd expect that to be true of XQuery too since the underlying
semantics are similar.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Sep 5 '06 #2
Hi,

"Some..in..satisfies" _is_ standard XQuery and has been for a long time;
I'm not sure why Tamino wouldn't support it.

But anyway, how about something like (untested):

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

Hope that helps,
Priscilla
---------------------------------------------
Priscilla Walmsley
Author, XQuery (Coming in 2006 from O'Reilly)
http://www.datypic.com
http://www.xqueryfunctions.com
---------------------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Sep 10 '06 #3
problem solved.

Tamino Developers said:
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>

Sep 10 '06 #4
problem solved.

Tamino Developers said:

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()

Sep 10 '06 #5
Hi,

I don't think this is the same thing because you are going to get
duplicate results for the same auction if there is more than one bid
that satisfies the condition.

Priscilla

----------------------------------
Priscilla Walmsley
Author, Definitive XML Schema
Definitive XQuery
http://www.datypic.com
----------------------------------

*** Sent via Developersdex http://www.developersdex.com ***
Sep 10 '06 #6
Priscilla Walmsley wrote:
Hi,

I don't think this is the same thing because you are going to get
duplicate results for the same auction if there is more than one bid
that satisfies the condition.

Hi !

I wanted to test both. But the query doesn't give a result on the XMark
generated data.
I don't know why is this query in the XMark Tests included....

But I think you are right
Thank you Priscilla !

You are super *g*

Sep 10 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom Corcoran | last post by:
I am working to ease updating of a html page by transforming 2 xml files. I was going to use xslt for this and had bought 2 unopened books, wrox xslt and o'reilly's xslt cookbook. But am now...
0
by: Benjamin G. Jones | last post by:
I am having a very basic problem with XQuery. I want to use an XQuery API in Java (either Saxon or Qexo), and I have an XQuery expression that works as expeced from the command line if I specify...
0
by: Tony Lavinio | last post by:
Dear Stylus Studio Friends, The new year is scarcely one month old, but we already have lots to report! For starters, there's Stylus Studio 6 Release 2. The latest release of Stylus Studio...
0
by: Stylus Studio | last post by:
DataDirect XQuery(TM) is the First Embeddable Component for XQuery That is Modeled after the XQuery API for Java(TM) (XQJ) BEDFORD, Mass.--Sept. 20, 2005--DataDirect Technologies...
0
by: paul.rusu | last post by:
(:// start/stop trace:) (: for $x in doc ($doc_name)/ProcessValueTrace/Trace, $y in $x/StartTrace, $z in $x/StopTrace return <Trace> { $y } { $z }
8
by: Clamps | last post by:
So I've been reading about XQuery, but cannot find a dll or namespace download to use the technology in vs.net 2002 or 2003. Any directions would be great. -- "If I'm the president, we're going...
7
by: paul.rusu | last post by:
I have a element "v" wich has different types of objects a,b,c. and i do: for $x in $doc/v/a where ... return $x for $x in $doc/v/b where ... return $x for $x in $doc/v/c where ... return $x...
2
by: Ale | last post by:
Hi all! I need to build a middleware for XQuery: I mean a software receiving a std xquery and outputting the xquery result on "database.xml". This middleware must use 7 or 8 different choosable...
2
by: tammo.mueller | last post by:
Hi, I'm trying to execute a xquery statement and I get always errors. It seems that only the prolog section is giving me errors. If I want to declare a namespace the xquery processor is coming...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.