W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

key/keyref and xs:ID/xs:IDREF

From: Eddie Robertsson <eddie@allette.com.au>
Date: Fri, 18 Jan 2002 10:06:26 +1100
Message-ID: <3C4758F2.F4D592E4@allette.com.au>
To: XSD <xmlschema-dev@w3.org>
Hi,

I couple of weeks back I discovered that MSXML4 had some problems
validating xs:key and xs:keyref when the XML Schema datatype used for
the element/attribute with the xs:key was defined as xs:ID and the type
of the element/attribute with the xs:keyref was defined as xs:IDREF. I
asked them about this and I just got this reply back:

--------8<----------
Hello,

Yes, we are aware of this behavior. The reason for this problem is as
follows:

The XSD 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.
ID
and IDREF are peer types, both deriving from NCNAME, thus they can not
be
compared.
--------8<-----------

I seems this is a correct interpretation of the spec [1] but is this
really the way it's supposed to be? It seems strange that you can't have
an element of type xs:IDREF reference another element of type of xs:ID
using XML Schema's key/keyref functionality.

Cheers,
/Eddie

[1]
http://www.w3.org/TR/xmlschema-1/#Identity-constraint_Definition_details
Received on Thursday, 17 January 2002 17:56:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT