W3C home > Mailing lists > Public > public-qt-comments@w3.org > August 2003

RE: ORA-FO-RETURN-TYPECHECK

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Wed, 6 Aug 2003 00:18:53 +0200
Message-ID: <DFF2AC9E3583D511A21F0008C7E62106073DD03A@daemsg02.software-ag.de>
To: Ashok Malhotra <ashokma@microsoft.com>, Stephen Buxton <stephen.buxton@oracle.com>, public-qt-comments@w3.org
> 
> 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

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