RE: [XQuery] Error Handling ?

>
>
>> This is a badly lacking feature in XQuery:
>> AFAIK, there is no way to recover/catch a dynamic error after it
>happens.
>
>> 1) introduce an error catching mechanism
>
>The WG considered adding this functionality to XML Query and decided to
>not add it to XML Query 1.0.  
>  
>

I wonder whether the WG members have ever tried to write *real* 
applications with XQ!
Do they think it is acceptable that a query exits with a fatal error 
just because
  of an unsuccessful attempt to open a document ?
I wrote a small yet real application (300 lines to generate my web site 
from bare XML content)
and I found simply indispensible to add something.
It took me less than 10 minutes to implement  the function 
catch-error(expression, fallback)

>This decision was made in late 2002 and is recorded at [1].
>
>The WG knows that there are several things missing from XML Query 1.0
>e.g. an update language.  If we included everything that was requested
>we would simply never get a Version 1.0 completed. 
>  
>

Frankly speaking, I would say that a V1.0 without a proper error 
handling is *not* completed.

>> 2) at the very least, consider modifying some functions like doc()
>>   so that they return a conventional value (eg the empty sequence)
>>   instead of raising an error
>
>I am not sure why you would want the doc() function to be silent about
>errors it encounters.  Can you explain why you want this result?
>  
>

I don't want it to be silent, this is just a desperate solution in case 
no catching mechanism
is introduced.
Another solution is to add functions like test-doc-access() to check a 
possible
error before trying doc(), but this is poor design.

Received on Saturday, 31 January 2004 19:38:24 UTC