[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message]

FLOR or FLWOR

Michael Kay mike at saxonica.com
Wed Sep 10 12:01:15 PDT 2008


  FLOR or FLWOR
There are some cases where using a predicate may be inconvenient, but it is
always possible. This query is equivalent to 
 
distinct-values($values)[let $v := . return count($values[. = $v] > 2]
 
or if you prefer (or if you are restricted to XPath 2.0 syntax)
 
distinct-values($values)[exists(index-of($values, .))[3]]
 
Michael Kay
http://www.saxonica.com/
 
 


  _____  

From: http://x-query.com/mailman/listinfo/talk [mailto:http://x-query.com/mailman/listinfo/talk] On Behalf
Of Rémi Dewitte
Sent: 10 September 2008 10:35
To: http://x-query.com/mailman/listinfo/talk
Cc: Robert Koberg; http://x-query.com/mailman/listinfo/talk
Subject: Re:  FLOR or FLWOR


Hi,
I do have an example. Correct ?

for $v in distinct-values($values) where count($values[. = $v]) > 2 return
$v

Rémi


On Wed, Sep 10, 2008 at 11:02 AM, <http://x-query.com/mailman/listinfo/talk> wrote:


Hey Rob,

i have had a situation in where the XPath predicate selection does not fit
my requirements. I think it was something concerning a query, that combines
to sequences, but i'm not sure. It is a long time ago and i can't find the
example.

But the where is essential in some case. But you're right, most of the
selections can be done with XPath.

HTH
Timothy
----- original Nachricht --------

Betreff:  FLOR or FLWOR
Gesendet: Mi 10 Sep 2008 03:02:44 CEST
Von: "Robert Koberg"<http://x-query.com/mailman/listinfo/talk>

> Hi,

>
> Where would you use 'where' that couldn't be handled by XPath? In
> other words, why is there a where?
>

> best,
> -Rob

> _______________________________________________
> http://x-query.com/mailman/listinfo/talk
> http://x-query.com/mailman/listinfo/talk
>


--- original Nachricht Ende ----



_______________________________________________
http://x-query.com/mailman/listinfo/talk
http://x-query.com/mailman/listinfo/talk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://x-query.com/pipermail/talk/attachments/20080910/dae7313d/attachment.htm


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.