RE: Questions about "equal" fundamental facet

Sandy, see comments inline.

All the best, Ashok 
===========================================================


-----Original Message-----
From: sandygao@ca.ibm.com [mailto:sandygao@ca.ibm.com] 
Sent: Wednesday, April 24, 2002 11:43 AM
To: www-xml-schema-comments@w3.org
Subject: Questions about "equal" fundamental facet

1. Is it defined on "value spaces", or "types"?

In 4.2.1 of the datatype spec: "Every *value space* supports the notion
of
equality, ...". So it seems that "equal" is defined on "value spaces".
Does
this imply that two (unconnected) types (with the same value space) can
have equal values? For example, hexBinary and base64Binary have the same
value space ("the set of finite-length sequences of binary octets").
hexBinary value "00" and base64Binary value "AA==" both represent one
byte
of value "0". Then are the two values equal? I would say they are equal,
if
"equal" is defined on value spaces.

But 3.11.1 of the structure spec says "Values of differing type can only
be
equal if one type is derived from the other, and the value is in the
value
space of both". Here it seems to indicate something different. Is this a
contradiction?
[AM] Equality is defined on values.  The values must be in the same
value space. Since derivation by restriction merely narrows the value
space a value of a base type may equal a value of a derived (by
restriction) type.


2. Does the types have to be related by *restriction* or *union*?

If type A restricts "integer" by setting "minInclusive=0", and B
restricts
"integer" by setting "maxInclusive=10". Now A and B are not related by
restriction or union. But I still expect value "5" from both types
(values
spaces) to be equal.

(If they have to be related by *restriction* or *union*, doesn't 3.11.1
of
the structure spec need to be modified to be more strict, instead of
simply
saying "derived from"?)
[AM] By restriction.


My take on these 2 questions:

1. "equal" should be defined on value spaces, because equal values are
equal, no matter how they were lexically represented.
[AM] Correct!

2. Types used to generate equal (actual) values don't need to be
related.
As long as there exist a (primitive) value space to which both values
belong, and the two values are equal in that value space, then they are
equal. This means hexBinary and base64Binary can generate equal values,
so
can QName and NOTATION. Further on this, maybe the value space of
"float"
should (or already is) be a subset of that of "double", so that these
types
can generate equal values.
[AM] I don't know how to tell if two value spaces are subsets of some
primitive value space.  I only know such a relation exists for types
derived by restriction.

Thanks,
Sandy Gao
Software Developer, IBM Canada
(1-905) 413-3255
sandygao@ca.ibm.com

Received on Wednesday, 24 April 2002 17:03:17 UTC