Re: Options as strings. Blech.

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 UTC