RE: Semantics of boolean operators

I realize it's slightly off-topic from the semantic issue you're talking
about, but I'm wondering at the syntax level if it's possible to say

for $book in //book[ author[ firstname/text() = "John" and lastname/text() =
"Smith" ] ]
return $book/title

My own XQL-based query engine can do that (Jonathan can tell me whether
that's actually valid XQL or not -- I obviously thought it was when I was
building my parser :-). Is that doable in XPath/XQuery?

Howard

FOR $book in //book[ author[ firstname
> Date: Tue, 19 Jun 2001 17:18:11 -0500 (CDT)
> Message-Id: <200106192218.RAA12048@lambda.uta.edu>
> From: Leonidas Fegaras <fegaras@lambda.uta.edu>
> To: www-xml-query-comments@w3.org
> Subject: Semantics of boolean operators
>
> I was very pleased to read the new formal semantics for XQuery.
> It helped me understand XQuery better. I have a comment though:
>
> In section 6.2.4.1 (boolean operators) you expressed the semantics of
> boolean operators using (simulated) existential quantification.
> This may not work very well for the following query:
>
> for $a in //book
> where $a/author/firstname/text() = "John"
>   and $a/author/lastname/text() = "Smith"
> return $a/title
>
> because it will succeed for the following book:
>
> <book>
>   <author><firstname>John<firstname/><lastname>Walter</lastname></author>
>   <author><firstname>Jim<firstname/><lastname>Smith</lastname></author>
>   <title>...</title>
> </book>
>
> An alternative is to enforce the results of [[ E1 ]] and [[ E2 ]] in
> [[ E1 = E2 ]] to be singletons. If this is not what the user intended,
> then she may still use explicit existential quantification in the query.
> I don't feel very strongly about this, but whatever you choose,
> you should make it clear with examples.
>
> By the way, you don't need the outer semantic brackets [[]] at the
> righthand sides of the equations in 6.2.4.1.
>
> A minor typo: At the end of 6.2.1.3:
>                  [[ E/DATA() ]]  ==> for $v1 in [[ E ]] return
>                                        typed-value([[ E ]])
> should be:
>                  [[ E/DATA() ]]  ==> for $v1 in [[ E ]] return
>                                        typed-value($v1)
>
> Best regards
> Leonidas Fegaras
> Department of Computer Science and Engineering
> The University of Texas at Arlington
> 416 Yates Street, 301 Nedderman Hall
> P.O. Box 19015
> Arlington, TX 76019
>

Received on Wednesday, 20 June 2001 18:15:53 UTC