[xquery-talk] where clause

deBakker, Bas bas.debakker at emc.com
Wed Mar 27 05:26:52 PST 2013

Wouldn't that be equivalent to

    for $a in expr1, $b in expr2, $c in expr3[$a = $b + .]
    return $a


-----Original Message-----
From: talk-bounces at x-query.com [mailto:talk-bounces at x-query.com] On Behalf Of G. Ken Holman
Sent: Wednesday, March 27, 2013 14:19
To: talk at x-query.com
Subject: Re: [xquery-talk] where clause

At 2013-03-27 08:31 -0400, Michael Sokolov wrote:
>I'm trying to come up with examples in which "where" clauses cannot be 
>rewritten as XPath predicates.  So far, the ones I have all involve an 
>"at" counter.  Are there others?

I can see no difference off hand when creating 1-tuples, as a 1-tuple is essentially just a sequence.

However, when creating n-tuples (either with the "at" keyword as you say or with other bound variables in your expression), the where clause acts on the tuple, not just on a set of values.  Here is a 3-tuple expression example:

    for $a in expr1, $b in expr2, $c in expr3
    where $a=$b+$c
    return $a

I hope this is helpful.

. . . . . . . . Ken

Public XSLT, XSL-FO, UBL and code list classes in Europe -- Apr 2013 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm |
Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/q/ |
G. Ken Holman                   mailto:gkholman at CraneSoftwrights.com |
Google+ profile: https://plus.google.com/116832879756988317389/about |
Legal business disclaimers:    http://www.CraneSoftwrights.com/legal |

talk at x-query.com

More information about the talk mailing list