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
Given 

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:sequence>
                     <xs:element ref="_Geometry" minOccurs="0"/>
           </xs:sequence>
           <xs:attribute name="attA" use="optional"/>
</xs:complexType>

and 

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:complexContent>
                     <xs:restriction base="AbstractGeometryContainer">
                               <xs:sequence>
                                          <xs:element ref="Point" minOccurs
="0"/>
                               </xs:sequence>
                               <xs:attribute name="attA" use="optional"/>
                     </xs:restriction>
           </xs:complexContent>
</xs:complexType>
=======================

I think it is fine - per this section from
http://www.w3.org/TR/xmlschema-1/#coss-particle

-------------------
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Ě. 
...
-------------------

etc.  
Received on Thursday, 24 January 2002 22:46:44 GMT

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