This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10374 - minor editorial improvement : subtype clarification of ENTITIES, IDREFS & NMTOKENS
Summary: minor editorial improvement : subtype clarification of ENTITIES, IDREFS & NMT...
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Datatypes: XSD Part 2 (show other bugs)
Version: 1.1 only
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL: http://www.w3.org/TR/xmlschema11-2/
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2010-08-16 03:44 UTC by Mukul Gandhi
Modified: 2011-01-15 05:41 UTC (History)
1 user (show)

See Also:


Attachments

Description Mukul Gandhi 2010-08-16 03:44:23 UTC
In XSD 1.1 data types spec, the base type of ENTITIES, IDREFS and NMTOKENS is anySimpleType (this is reflected in the type hierarchy diagram available at, http://www.w3.org/TR/xmlschema11-2/#built-in-datatypes). But this particular type/subtype relationship is not described anywhere in the XSD 1.1 data types spec prose.

Whereas for many of the other built-in schema types, texts like following is provided in the spec:
"The ·base type· of xx is yy"

I think it would be good if the spec provides text like following for the types ENTITIES, IDREFS and NMTOKENS: 

3.4.12 ENTITIES -> The ·item type· of ENTITIES is ENTITY and base type is anySimpleType (the current text being -- The ·item type· of ENTITIES is ENTITY).

3.4.10 IDREFS -> The ·item type· of IDREFS is IDREF and base type is anySimpleType (the current text being -- The ·item type· of IDREFS is IDREF).

3.4.5 NMTOKENS -> The ·item type· of NMTOKENS is NMTOKEN and base type is anySimpleType (the current text being -- The ·item type· of NMTOKENS is NMTOKEN).

This change in text would particularly be helpful to readers, because in XSD 1.0 data types spec base types of ENTITIES, IDREFS and NMTOKENS were ENTITY, IDREF and NMTOKEN respectively.
Comment 1 David Ezell 2010-08-20 15:38:12 UTC
discussed on the conference call 2010-08-20
Comment 2 C. M. Sperberg-McQueen 2010-11-27 01:42:09 UTC
First a quick note on the final sentence of the problem description:

  in XSD 1.0 data types spec base types of ENTITIES, IDREFS and NMTOKENS 
  were ENTITY, IDREF and NMTOKEN respectively.

It's easy to understand how the diagram at the beginning of section 3, and the general informality of the prose in Datatypes 1.0, might have led to this view.  But in fact I have not found anything in 1.0 that actually says, when a type is derived by list or union, what its base type is. (It's possible I overlooked something.)

In the case of ENTITIES, IDREFS, and NMTOKENS, there is a slight complication in that they are derived from anySimpleType not in a single step but in two steps:  the declaration of ENTITIES in the schema for schema documents is given as


  <xs:simpleType name="ENTITIES" id="ENTITIES">
    <xs:annotation> ... 
      <xs:documentation source="http://www.w3.org/TR/xmlschema11-2/#ENTITIES"/>
    </xs:annotation>
    <xs:restriction>
      <xs:simpleType>
        <xs:list itemType="xs:ENTITY"/>
      </xs:simpleType>
      <xs:minLength value="1" id="ENTITIES.minLength"/>
    </xs:restriction>
  </xs:simpleType>

so strictly speaking its base type is not anySimpleType but the anonymous type declared in the lines

      <xs:simpleType>
        <xs:list itemType="xs:ENTITY"/>
      </xs:simpleType>

Perhaps instead of simply saying "The base type of ... is anySimpleType", we need to say something more detailed, for example

    ENTITIES is derived in two steps from anySimpleType:  an anonymous list type is
    defined with item type ENTITY; ENTITIES restricts the value space of this anonymous
    type to list of length greater than zero.

This may be more elaborate than is useful.
Comment 3 C. M. Sperberg-McQueen 2011-01-14 21:19:22 UTC
At the XML Schema working group call of 14 January 2011, the group agreed to add sentences along the lines of the text shown in comment 2 to the sections on the three datatypes in question.

This change has now been made in the status-quo documents at

  http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.diff.html
  http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.diff-1.0.html
  http://www.w3.org/XML/Group/2004/06/xmlschema-2/datatypes.diff-wd.html
  (member-only links)

Accordingly, I'm marking the bug resolved.

As the originator of the issue, Mukul Gandhi should in the normal course of events get an email notification of this change of status.  It would be helpful if you would examine the resolution of the issue and indicate by closing the bug that you are happy with the resolution, or by reopening it that you are not happy.  If we don't hear from you in the next two weeks we will assume that you are content with the resolution of the issue.  The WG thanks you for helping us make the spec clearer.
Comment 4 Mukul Gandhi 2011-01-15 05:41:53 UTC
Thanks for the resolution of this bug. I'm happy with the resolution, therefore I'm marking the issue closed.

Thanks.