RE: ORA-FO-CAST-BOOLEAN 15.1.4 fn:boolean

The text has been improved in the latest internal draft but it still suffers
the same editorial problem. The spec should say what fn:boolean does, and
this should be followed by a non-normative note explaining how and why it
differs from "cast as boolean".
 
Michael Kay

-----Original Message-----
From: Stephen Buxton [mailto:stephen.buxton@oracle.com] 
Sent: 30 June 2003 15:18
To: public-qt-comments@w3.org
Subject: ORA-FO-CAST-BOOLEAN 15.1.4 fn:boolean 



Functions and Operators, Section 15.1.4 fn:boolean <fn:boolean>  says "If
$srcval is an atomic value, then the function returns the same value as
returned by the expression cast as xs:boolean <xs:boolean>  ($srcval) with
the one exception described below. This exception is for compatibility with
[XPath 1.0]. Specifically, it returns false if $srcval is: .... " 
It then lists 4 possibilities. What is the "one exception" ? 


Possibly the exception is the second bullet - "The singleton
<Thesingletonxs:stringvalue> xs:string value "". (the zero-length string).
The expression cast as xs:boolean <xs:boolean>  ($srcval) returns false if
$srcval is "0" and true if $srcval is "1".". 
Why are we comparing what fn:boolean <fn:boolean>  does with the zero-length
string as input vs what cast as xs:boolean <xs:boolean>  does with "0" or
"1" as input ? 


Suggest: if there is only one difference between fn:boolean <fn:boolean>
and cast as xs:boolean <xs:boolean> , then either describe the behaviour
fully in one section and just mention the exception in the other, or
describe the behaviour fully, using the same format and notation, in both
sections and note the exception in both sections.

Received on Tuesday, 1 July 2003 16:44:14 UTC