Re: [F&O] Casting to numerics missing lexical check

Ah I see. This unfortunately makes the spec less readable, but the 
tradeoff between readability and redundancy is tough. There is also 
some inconsistency as numerics refer to the constructor, but for 
duration it is explicit; this calls attention to differences that 
aren't there.

Thanks,
--Sarah

On Nov 19, 2003, at 11:11 AM, Ashok Malhotra wrote:

> Hi Sarah:
> I'm happy someone is reading the spec so closely!
> Here is the rationale for the new wording.
>
> - ... TV is xs:float(IV)
>
> Calls the constructor for xs:float with the string value IV.
> If IV does not have the appropriate lexical type the constructor will
> raise an error.  This covers the case you are (legitimately) worrying
> about.
>
>
> All the best, Ashok
>
> -----Original Message-----
> From: public-qt-comments-request@w3.org
> [mailto:public-qt-comments-request@w3.org] On Behalf Of Sarah Wilkin
> Sent: Wednesday, November 19, 2003 10:40 AM
> To: public-qt-comments@w3.org
> Subject: [F&O] Casting to numerics missing lexical check
>
>
> In section 17.8, Casting to numeric types, all references to checking
> the intermediate value xs:string against the lexical were removed. This
> looks incorrect as with the new spec xs:float("foo") would be valid.
>
> For example, for xs:float, the May'03 spec stated:
> - If IV is not in the lexical space of xs:float, as defined in XML
> Schema Part 2: Datatypes, then an error is raise ("Invalid lexical
> value")
> - Otherwise, TV is xs:float(IV) ...
>
> But in the Nov'03 spec, it just says:
> - If ST is xdt:untypedAtomic, xs:anySimpleType or xs:string or a type
> derived fromxs:string, SV is converted to  an intermediate value IV of
> type xs:string and TV is xs:float(IV).
>
> It seems the rules should follow the form:
> - If ST is xdt:untypedAtomic, xs:anySimpleType or xs:string or a type
> derived fromxs:string, SV is converted to  an intermediate value IV of
> type xs:string
> - If IV is not in the lexical space of xs:float, as defined in XML
> Schema Part 2: Datatypes, then an error is raised ("Invalid lexical
> value")
> - Otherwise, TV is xs:float(IV)
>
> --Sarah
>

Received on Wednesday, 19 November 2003 14:33:14 UTC