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

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:11:27 UTC