RE: Mixed type fields

> -----Original Message-----
> From:	ht@cogsci.ed.ac.uk [SMTP:ht@cogsci.ed.ac.uk]
> Sent:	Monday, January 22, 2001 1:51 AM
> To:	James Clark
> Cc:	XML Schema Comments
> Subject:	Re: Mixed type fields
> 
> James Clark <jjc@jclark.com> writes:
> 
> > What happens if fields in identity constraints evaluate to values of
> > different types for different target node-sets? This would require be to
> > compare values of different types.  Is this an error, always false,
> > false only if they do not have a common super type or what?
> 
> Should be clarified.  I _think_ (need confirmation from the Datatypes
> editors) that values from distinct value spaces always compare not
> equal, but that a derived type's values _are_ in the same value space as
> its base type, so e.g. 
> 
> 3 [integer] = 3 [short]
> 
> and "foo" [string] = "foo" [token]
> 
Yes, that is correct.  From section "2.4.1.1 Equal" of part 2 [1]

	For any values a, b drawn from the value space,
	Equal(a,b) is true if a = b, and false otherwise.
 
	By definition, given value space  A and value space B
	where A and B are not related by restriction, for every
	pair of values a from A and b from B, a != b.

However, looking at that I now realize I need to update the 2nd sentence to
include derivation by union as well, since unions work the same as
restriction as far as equality is concerned.

pvb

References
[1] http://www.w3.org/TR/xmlschema-2/#equal

Received on Monday, 22 January 2001 13:45:55 UTC