W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2011

Re: Options as strings. Blech.

From: Andrew Welch <andrew.j.welch@gmail.com>
Date: Fri, 2 Sep 2011 11:20:18 +0100
Message-ID: <CAEG2duDeJ=SwkNAqevcDBrXbOiTX770QuEhVSGTaOND6z_s1YQ@mail.gmail.com>
To: Florent Georges <fgeorges@fgeorges.org>
Cc: vojtech.toman@emc.com, xproc-dev@w3.org
On 2 September 2011 11:10, Florent Georges <fgeorges@fgeorges.org> wrote:
> On 2 September 2011 11:25, ? wrote:
>
>  Hi,
>
>> But I still think that if var is equal to '0' (as the result
>> converting 0 to a string), then the effective boolean value of
>> the expression $var is false() in XPath 2.0.
>
>  If we look at the definition of EBV[1], actually any string
> returns true except the empty string.  So even 'false' returns
> true:
>
>    (: returns true() :)
>    if ( 'false' ) then true() else false()
>
>    (: returns false() :)
>    xs:boolean('false')

Don't forget the gotcha that the only non-empty string to return false
is '0'... xs:boolean('0') returns false.





-- 
Andrew Welch
http://andrewjwelch.com
Received on Friday, 2 September 2011 10:20:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 2 September 2011 10:20:46 GMT