W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

CR-50 response: IDREF and Union Types

From: Priscilla Walmsley <priscilla.walmsley@xmls.com>
Date: Tue, 23 Jan 2001 17:38:29 -0500
To: "'Jane Hunter'" <jane@dstc.edu.au>
Cc: "'XML Schema Comments'" <www-xml-schema-comments@w3.org>
Message-ID: <001501c0858e$7971b840$d5b0153f@xmls>
Dear Jane,

The W3C XML Schema Working Group has spent the last several weeks
working through the comments received from the public on the
Candidate Recommendation (CR) of the XML Schema specification. We
thank you for the comments you made on our specification during
our CR comment period, and want to make sure you know that all
comments received during the CR comment period have been recorded
in our CR issues list (http://www.w3.org/2000/12/xmlschema-crcomments.html).

You raised the point registered as issue CR-50: IDREF and Union Types.

In a related issue, CR-14, we determined that the value space of IDREF is
the set of all valid names (i.e. strings that match the NCName production),
and that the constraint that IDREFs must match a corresponding ID will no
longer be a condition of type validity.  It will continue to be described
separately as a constraint.

Therefore, to use your example:

   <simpleType name="referenceType">
     <union memberTypes="IDREF uriReference mpeg7:xPathType"/>

The schema processor checks the member types in the order in which they
appear in the definition until a match is found, _based on type validity_.
If the schema processor gets a value of "foo", it will be considered an
IDREF (because it is a valid name), whether it matches an ID or not.  If it
then finds that it does not match an ID, it will raise an error.

A consequence is that no uriReferences or xPathTypes may be used that are
also valid names (e.g. "bar"), because they will be determined to be an
IDREF and the processor will raise an error (unless a corresponding ID
happens to exist.)

Changing the order that IDREF appears in the memberTypes list would help get
around this, but then the IDREF constraint would not be validated ("foo"
would be considered a valid uriReference). If validating this constraint is
important to you, I would recommend using the xsi:type attribute in the
instance document to indicate which type it is intended to match. For

	<reference xsi:type="IDREF">foo</reference>

It would be helpful to us to know whether you are satisfied with the
decision taken by the WG on this issue, or wish your dissent from the
WG's decision to be recorded for consideration by the Director of
the W3C.


Priscilla Walmsley
XML Schema Working Group
Received on Tuesday, 23 January 2001 17:48:14 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:54 UTC