W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2004

RE: [XQuery] Error Handling ?

From: Paul Cotton <pcotton@microsoft.com>
Date: Sat, 31 Jan 2004 16:13:15 -0800
Message-ID: <33D970235519324D988AFFDE7EA2E24C92CD16@RED-MSG-41.redmond.corp.microsoft.com>
To: "Xavier Franc" <xfranc@online.fr>
Cc: <public-qt-comments@w3.org>

> 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.  

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. 

> 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?

/paulc

[1]
http://www.w3.org/XML/2003/11/xpath-xquery-issues/#xquery-try-catch-erro
r

Paul Cotton, Microsoft Canada 
17 Eleanor Drive, Nepean, Ontario K2E 6A3 
Tel: (613) 225-5445 Fax: (425) 936-7329 
mailto:pcotton@microsoft.com

  

> -----Original Message-----
> From: public-qt-comments-request@w3.org [mailto:public-qt-comments-
> request@w3.org] On Behalf Of Xavier Franc
> Sent: January 31, 2004 6:06 PM
> To: public-qt-comments@w3.org
> Subject: [XQuery] Error Handling ?
> 
> 
> 
> 
> Actually, at least two kinds of dynamic errors should be
distinguished:
> fatal / non-fatal, or non-recoverable / recoverable
> (XSLT2 has this distinction).
> 
> Clearly there is a semantic difference between:
> 1)  a wrong regular expression: this is a programming error,
>       there is no real point to recover it
> 2) trying to parse a document is an environment-dependent
>     operation, that may fail for unpredictable reasons:
>   there isdefinitely a need to recover such an error
> 
> Two possible solutions:
> 
> 1) introduce an error catching mechanism
>      -- in my implementation (Qizx/open) I have simply added a
> catch-error() function.
>     But a more sophisticated mechanism (try/catch) would probably be
> better.
> 
> 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
> 
Received on Saturday, 31 January 2004 19:13:40 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:16 UTC