W3C home > Mailing lists > Public > www-ql@w3.org > January to March 2006

RE: question about subtyping and type annotations

From: Michael Rys <mrys@microsoft.com>
Date: Thu, 23 Feb 2006 20:41:57 -0800
Message-ID: <07D2490E9E33124B8ED67F01E828B9E715DE9E@RED-MSG-70.redmond.corp.microsoft.com>
To: "Per Bothner" <per@bothner.com>, <www-ql@w3.org>

I agree with your assessment that xs:integer(xs:byte(100)) should have a
type annotation of xs:integer. Mike apparently disagrees. You should
file a Mozilla request to add this to the test suite.

Best regards

> -----Original Message-----
> From: www-ql-request@w3.org [mailto:www-ql-request@w3.org] On 
> Behalf Of Per Bothner
> Sent: Thursday, February 23, 2006 7:30 PM
> To: www-ql@w3.org
> Subject: question about subtyping and type annotations
> I'm unclear on the semantic model for type annotations, and I can't
> find a clear answer in the specifications or in the test suite.
> I gather (and Saxon agrees) that:
>    100 instance of xs:byte ==> false
> because 100 has "type annotation" xs:integer, which is not a sub-type
> of xs:byte.
> Using the cast xs:byte creates a value with type annotation xs:byte:
>    xs:byte(100) instance of xs:byte ==> true
> What about xs:integer(xs:byte(100))?  I would expect this to return
> a value with type annotation xs:integer, but Saxon (b8-6-1) disagrees:
>    xs:integer(xs:byte(100)) instance of xs:byte ==> true ????
> This implies that if the argument already conforms to the 
> casted-to-type
> then it it returned changed.  That is certainly a possible behavior,
> but another behavior is that casting to xs:integer returns a value
> with annotation xs:integer.  That seems more consistent to me.
> The formal semantics just refers to chapter 17 of Functions and
> Operators, which mainly specifies which conversions are valid.
> The formal semantics should probably specify the resulting "formal
> values" after a cast.
> Either way, this should be tested in the test suite.  I didn't
> find it (using a quick grep).
> -- 
> 	--Per Bothner
> per@bothner.com   http://per.bothner.com/
Received on Friday, 24 February 2006 04:42:08 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:43:44 UTC