F&O Casting from binary types to xs:boolean

I'm not sure why someone would need to cast hexBinary and base64Binary
to boolean, but of course there may be a use case I haven't thought of.
However, the casting rule is a little unclear.  It says:

"If ST is xs:base64Binary or xs:hexBinary and SV is " 1 ", then TV is
true; if ST is xs:base64Binary or xs:hexBinary and SV is " 0 ", then TV
is false."


1. Putting the values " 1 " and " 0 "  in quotes implies that these are
valid lexical forms for these types.  They aren't, since these values
must come in octets.  Was the intention that hexBinary "01" be cast to
boolean true?  What about hexBinary "0001" ?  

2. What if the value is not equivalent to 0 or 1?  It doesn't say
whether it should be cast to true, raise an error, or what.

Thanks,
Priscilla

Received on Saturday, 10 May 2003 08:18:06 UTC