RE: ORA-FO-RETURN-TYPECHECK

> 
> Steve:
> Interesting question!
> 
> It depends on how the user writes the function, does it not?

If the user-written function is written in XSLT, then the rules are clear:
 
http://www.w3.org/TR/xslt20/#stylesheet-functions

"If the as attribute is specified, then the result evaluated by the sequence
constructor  is converted to the required type, using the argument
conversion rules. It is a type error if this conversion fails. If the as
attribute is omitted, the calculated result is used as supplied, and no
conversion takes place."

If the user-written function is written in XQuery, then the rules are given
in:

http://www.w3.org/TR/xquery/#id-function-calls

"The value returned by the function body is then converted to the declared
return type of the function by applying the function conversion rules".
(It's implicit that if conversion is not possible, you get an error).

So I think this is all well-defined. The return value is guaranteed to be a
valid instance of the declared return type. 

Michael Kay



> 
> All the best, Ashok
> 
> > -----Original Message-----
> > From: public-qt-comments-request@w3.org [mailto:public-qt-comments- 
> > request@w3.org] On Behalf Of Stephen Buxton
> > Sent: Monday, June 30, 2003 6:35 PM
> > To: public-qt-comments@w3.org
> > Subject: ORA-FO-RETURN-TYPECHECK
> > 
> > 
> > Are atomicType results returned by a user-defined function 
> typechecked
> ?
> > 
> > e.g. myHeight has a max value of 100.
> >  If I define a function that returns myHeight, is there a guarantee
> that
> > the value returned by the function is not greater than 100 ?
> > 
> > 
> > 
> 
> 

Received on Tuesday, 5 August 2003 18:19:06 UTC