Re: [xml-dev] XQuery and DTD/Schema?

From
Jeni Tennison <>
To
Michael Kay <>
Date
2002-07-08T10:26:20Z
ID
<>
Thread
Re: [xml-dev] XQuery and DTD/Schema?
Mike,

> One design approach, of course, is for functions to return () (or
> other special values such as NaN) rather than throwing errors. The
> disadvantage of this is that there is no opportunity to provide
> diagnostics indicating the nature of the failure.

I had the (probably baseless) impression that an "error object" would
be returned rather than thrown, with its value being an error message
or something, so you could do something like:

  let $date := cast as xs:date('2002-02-29')
  if   ($date instance of error)
  then concat('Invalid date: ', $date)
  else ...

Is that not feasible?
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/