Re: XQuery

Guido, you suggested that null values be introduced into XQuery, and met 
with a lot of opposition.  But, from your examples, it seems like what 
you really wanted was something like "use null semantics when evaluating 
where conditions".  You don't actually want an XQuery expression to 
return null values, do you?  What if where clauses operated like SQL 
where clauses, returning false when there was a type conversion 
exception?  I guess this is pretty much what Michael Kay suggested.  (Of 
course, the counter-argument is that type-exception messages help 
programmers catch errors in their code and their data.   I understand 
both views.)

>    for $p in document("p.xml")//person
>    where is_null((number) $p/@age)  /* not exactly XQuery syntax, sorry */
>    return $p/@name

You can write this query using the "instance of" operator, right?  
(http://www.w3.org/TR/xquery/#id-instance-of)

for $p in document("p.xml")//person
where not($p/@age instance of xs:number)  /* I think this is xquery syntax */
return $p/@name


 > Indeterminism sucks!
By the way, I don't think anyone was really debating your argument that 
non-deterministic languages have serious disadvantages.  Basically, if I 
was to paraphrase all the responses, I would say that "non-deterministic 
languages have many problems, but we can't make XQuery deterministic 
because the performance would be unacceptably bad".

Bill Keese

PS: it took me a while to figure out that existentialism has nothing to 
do with Kafka.  (Especially since every Kafka book's main character is 
named "K", which is pronounced the same as "Kay"...)

Received on Thursday, 16 October 2003 22:12:31 UTC