|
[XQuery Talk Mailing List Archive Home] [By Date] [By Thread] [By Subject] [By Author] [Recent Entries] [Reply To This Message] FLOR or FLWORMichael Kay mike at saxonica.comWed Sep 10 12:01:15 PDT 2008
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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






