Lists Home |
Date Index |
From: Michael Kay [mailto:firstname.lastname@example.org]
Sent: Mon 7/8/2002 2:52 AM
To: Dare Obasanjo; 'Jonathan Robie'; 'Mike Champion'; email@example.com
Subject: RE: RE: [xml-dev] XQuery and DTD/Schema?
>If you have any constructive suggestions as to what kind of error-handling facility would keep your face straight,
> I'm sure the WG will be interested in hearing it.
I seem to remember a proposal for a function similar to the ternary operator in C for which the syntax escapes me. Something like
attempt(expr-to-attempt, expr-to-execute-on-success, expr-to-execute-on-failure)
which although not as complex as a structured exception handling mechanism like those in conventional programming languages like C# or C++ should satisfy users in most cases and not be onerous to implement. More complex exception handling mechanisms can be added in later versions of XQuery after user feedback has been gathered.
>Note that XSLT also has problems in this area: the inability of applications to deal with errors from the document() function is a perennial user complaint.
>One design approach, of course, is for functions to return () (or other special values such as NaN) rather than throwing errors.
I personally believe this should be avoided as much as possible. The empty set (or sequence) is not the error value and should not be used interchangeably with it.