RE: [F+O] Relationship of casts and constructors

Mike:
Thank you for your comment.  The WGs discussed this last week and agreed
that the wording could be improved.  I've unified the errors into one
"invalid value for cast/constructor".  I'm not crazy about the phrase
and am happy to consider an alternate wording.

I've also improved the wording some.

The fifth para of the constructor section is copied below.  I think this
makes it clear that the semantics are identical.  We could make this
para more prominent if you think that would help.

"The semantics of the constructor function "xs:TYPE(arg)" are identical
to the semantics of "arg cast as xs:TYPE". See 17 Casting. In some
cases, the semantics of casting are explained using constructor
functions; but there is no circularity. The constructors used in these
explanations invariably take xs:string arguments and, in this case, the
semantics are the semantics of XML Schema validation as discussed
above." 

All the best, Ashok

-----Original Message-----
From: public-qt-comments-request@w3.org
[mailto:public-qt-comments-request@w3.org] On Behalf Of Michael Kay
Sent: Sunday, February 08, 2004 3:13 PM
To: public-qt-comments@w3.org
Subject: [F+O] Relationship of casts and constructors


F+O still describes casts and constructor functions in separate
sections: it is not clear that they are completely synonymous with each
other.

For example, it appears that you will get different errors depending on
whether you use a cast or a constructor function. 

Constructors should be defined entirely in terms of casts, or vice
versa. If the two cases generate different error codes, implementations
can't treat them as being purely different surface syntax for the same
operation.

Note also my separate comment that the XPath language spec defines error
codes for casting which conflict with the codes defined in F+O.

Michael Kay

Received on Wednesday, 10 March 2004 16:52:10 UTC