W3C home > Mailing lists > Public > www-webdav-dasl@w3.org > April to June 1998

Question about the syntax for queries

From: Babich, Alan <ABabich@filenet.com>
Date: Fri, 17 Apr 1998 13:12:12 -0700
Message-ID: <72B1992276A9D111A20E00805FEAC96D0FD642@cm-expo1.filenet.com>
To: "'Saveen Reddy (Exchange)'" <saveenr@Exchange.Microsoft.com>
Cc: www-webdav-dasl@w3.org

The "00" spec. has

 <!ELEMENT and    (expr+) >
 <!ELEMENT or     (expr+) >

to define the syntax for "and" and "or" expressions. 
However, "and" and "or" are binary operators
(which we would like to extend to be n-ary operators, 
since they are associative and commutative). 
My understanding of "+" in XML is that it means 
"one or more". So, the way I read the above
syntax is that it allows an "and" expression to have
one operand. For example,


or, translating into the usual mathematical
notation, "AND X > 1".

However, "and" is not a unary operator, i.e., it takes 
at least two operands. So, shouldn't the syntax be

 <!ELEMENT and    (expr, expr+) >
 <!ELEMENT or     (expr, expr+) >

to force at least two operands for "and" and "or"?

Now, I realize that we could extend "and" and
"or" to unary operators by defining them to be
the identity operator if they have just one operand.
However, I would oppose that, as it would not be
doing a favor to any implementer translating
the XML query expression into SQL or whatever
he needs to translate it to. The implementer would have to 
make a special case out of that, but nothing
is gained for the effort. I would rather have
unary "and" and "or" operators be illegal
syntax by using the revised syntax shown above.

I'm new to XML, so I may have missed the point,
so, what are your comments?

Alan Babich
Received on Friday, 17 April 1998 16:14:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:22:38 UTC