Re: Type errors with xsd:boolean arguments

Eric Prud'hommeaux wrote:
> On Mon, Sep 19, 2005 at 01:51:39PM +0100, Dave Beckett wrote:
> 
>>There seems to be a clash between:
>>  "Functions invoked with an argument of the wrong type will produce a
>>  type error." (11.2)
>>vs
>>  "When a operand is coerced to xs:boolean through invoking a function
>>  that takes a xs:boolean argument, the following rules apply: ..."
>>  (11.2.2)
>>
>>which seems to imply that an arguments to a function that are of type
>>xsd:boolean are always co-erced and never produce a type error?

The only defined functions/operators to take booleans are sop:logical-or, 
sop:logical-and and fn:not.  It might be clearer to explicitly talk about them 
and give the "not" truth table.

Are extension functions typed?  I would hope that EBV rules do not apply and 
they get passed their arguments as-is.

 Andy

> 
> 
> I believe that is true. The ebv rules will give a boolean from any
> arguments. 
> 
> 
>>If that's the case, I suggest changing 11.2 something like:
>>  Functions invoked with an argument of the wrong type (except
>>  xsd:boolean) will produce a type error.
>>  Functions requiring an argument of type xs:boolean are coerced to
>>  xs:boolean using the EBV rules in section 11.2.2
> 
> 
> Done (1.503)
> 
> 
>>(Maybe there should be a new sub-section called "Type Errors"?)
>>
>>Dave
>>

Received on Tuesday, 11 October 2005 08:25:12 UTC