Lee Buck's use case returns: a hesitant proposal for type modification

Someone recently observed to me that we don't explicitly rule out
circular type definition.  We certainly should, but I wonder if we
should consider a carefully controlled exception to this, and to the
no redefinition/redeclaration rule:  You can redefine or redeclare
imported or included components _inside the include/import element_,
and only there.  Furthermore, such redefinitions may be 
circular in the case of types, named model groups and attribute
groups, and all such redefinitions are retrospective, i.e. they effect 
the included/imported components which reference those definitions.

Simple example

schema1.xsd

  <schema xmlns='http://www.w3.org/1999/XMLSchema'
          targetNamespace='http:///www.example.com/stuff'
          xmlns:m='http:///www.example.com/stuff'>
   <complexType name="personName">
     <sequence>
      <element name="forename"/>
      <element name="middle" minOccurs="0" maxOccurs="unbounded"/>
      <element name="surname"/>
     </sequence>
    </complexType>

    <element name="person" type="m:personName"/>

    <element name="record">
     <complexType>
      <sequence>
        <element ref="m:person"/>
        <element name="position">...</element>
        ...
      </sequence>
     </complexType>
    </element>
   </schema>

schema2.xsd

  <schema xmlns='http://www.w3.org/1999/XMLSchema'
          targetNamespace='http:///www.example.com/stuff'>
    <include "schema1.xsd">
      <complexType name="personName" base="m:personName"
                   derivedBy="extension"/>
        <element name="genMark" minOccurs="0"/>
      </complexType>
    </include>
   </schema>

Documents using schema2 for the http:///www.example.com/stuff would be 
able to have <genMark> as a daughter of <person> in their <record>s,
whereas those using schema1 would not.

I certainly haven't thought through all the ramifications of this, but 
if we want to do anything at all to allow ourselves to reuse our own
work, this is the best thing I've thought of.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Friday, 12 May 2000 05:40:29 UTC