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

Is this a valid <restriction > of a complex type

From: <Simon.Cox@csiro.au>
Date: Fri, 25 Jan 2002 11:38:57 +0800
Message-ID: <116D27C8E12BD411B3AB00B0D022B0B8AF0931@yate.wa.csiro.au>
To: xmlschema-dev@w3.org

1. a global declaration of the head of a substitutionGroup

<xs:element name="_Geometry" abstract="true"/>

2. a complex type that contains these in its content model

<xs:complexType name="AbstractGeometryContainer" abstract="true">
                     <xs:element ref="_Geometry" minOccurs="0"/>
           <xs:attribute name="attA" use="optional"/>


3. a global declaration of a member of the _Geometry substitutionGroup

<xs:element name="Point" type="PointType" substitutionGroup="_Geometry"/>

can we derive PointContainer in one step

<xs:complexType name="PointContainer">
                     <xs:restriction base="AbstractGeometryContainer">
                                          <xs:element ref="Point" minOccurs
                               <xs:attribute name="attA" use="optional"/>

I think it is fine - per this section from

Schema Component Constraint: Particle Valid (Restriction) 

[Definition:]  For a particle (call it R, for restriction) to be a valid
restriction of another particle (call it B, for base) one of the following
must be true:
1 ... 
2 depending on the kind of particle, per the table below, with the
qualifications that all of the following must be true:
2.1 Any top-level element declaration particle (in R or B) which is the
{substitution group affiliation} of one or more other element declarations
is treated as if it were a choice group whose {min occurs} and {max occurs}
are those of the particle, and whose {particles} consists of one particle
with {min occurs} and {max occurs} of 1 for the top-level element
declaration and for each of the declarations in its Ěsubstitution groupĚ. 

Received on Thursday, 24 January 2002 22:46:44 UTC

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