RE: Derivation by restriction from <any>

> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@jenitennison.com] 
> Sent: Friday, March 08, 2002 2:07 AM
> To: Dare Obasanjo
> Cc: Henry S. Thompson; Simon.Cox@csiro.au; xmlschema-dev@w3.org
> Subject: Re: Derivation by restriction from <any>
> 
> 
> Hi Dare,
> 
> > Upon investigating the W3C XML Schema Structures specification I've 
> > had some difficulty locating where it specifies that one-to-many 
> > particle derivations are acceptable. I would appreciate a 
> pointer to 
> > where in the recommendation it mentions that this is possible. From 
> > what I've read[0] particle derivation is a one-to-one affair.
> 
> The specific derivation from this example is a derivation by 
> restriction from the base model group:
> 
>   <sequence>
>     <any maxOccurs="unbounded"/>
>   </sequence>
> 
> to the derived model group:
> 
>   <sequence>
>     <element name="e1" type="string"/>
>     <element name="e2" type="integer" minOccurs="0"/>
>     <element name="e3" type="date" minOccurs="0"/>
>   </sequence>
> 
> By the rules of the Schema Component Constraint: Particle Valid
> (Restriction) 
> (http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict), 
> the sequence in the base model group is "pointless" so the 
> base model group is equivalent to:
> 

I am curious as to what rules you used to come to that conclusion. The
original XML schema fragment was 
	
 <complexType name="basetype">
  <sequence>
    <any maxOccurs="unbounded"/>
  </sequence>
 </complexType>

 <complexType name="newtype">
  <complexContent>
    <restriction base="my:basetype">
      <sequence>
        <element name="e1" type="string"/>
        <element name="e2" type="integer" minOccurs="0"/>
        <element name="e3" type="date" minOccurs="0"/>
      </sequence>    
    </restriction>
  </complexContent>
 </complexType>

The rules for pointlessness for an xs:sequence are 

	<sequence> 
	One of the following must be true:
	2.2.1 {particles} is empty. [Dare - Nope, not in this case] 
	
	2.2.2 All of the following must be true:
	2.2.2.1 The particle within which this <sequence> appears has
{max occurs} and {min 	occurs} of 1. [Dare - the sequence does not
appear in a particle. Now it is possible that somewhere in the spec
defines some implicit particle similar to how there is an implicit
xs:complexContent child of a xs:complexType when it has particles as
children. If this is the case I'd appreciate it if you could point this
out]

Thanks. 

<snip stuff on restricting xs:any to xs:sequence> 

-- 
THINGS TO DO IF I BECOME AN EVIL OVERLORD #230
I will not procrastinate regarding any ritual granting immortality.

Received on Friday, 8 March 2002 22:09:19 UTC