RE: Is this valid?

I thought that but would like to know if the REC allows it given the rules in 
 
http://www.w3.org/TR/xmlschema-1/#rcase-RecurseAsIfGroup
and
http://www.w3.org/TR/xmlschema-1/#rcase-Recurse
 
Specifically can 
 
  <xs:sequence minOccurs="0">
                    <xs:element name="a1"/>
                    <xs:element name="b1"/>
   </xs:sequence>
 
be restricted to 
 
 <xs:element name="b1"/>
 
given the wording [not intentions] of the REC? 

 -----Original Message----- 
 From: Jeni Tennison [mailto:jeni@jenitennison.com] 
 Sent: Mon 7/22/2002 10:47 AM 
 To: xmlschema-dev@w3.org; Dare Obasanjo 
 Cc: 
 Subject: Re: Is this valid?
 
 

 Hi Dare,
 
 >     <xs:complexType name="A">
 >         <xs:sequence>
 >            <xs:element name="f"/>
 >            <xs:choice>
 >                <xs:choice minOccurs="1">
 >                    <xs:element name="a"/>
 >                   <xs:element name="b"/>
 >                 </xs:choice>
 >                 <xs:sequence minOccurs="0">
 >                     <xs:element name="a1"/>
 >                     <xs:element name="b1"/>
 >                 </xs:sequence>
 >             </xs:choice>
 >        </xs:sequence>
 >     </xs:complexType>
 >
 >    <xs:complexType name="B">
 >         <xs:complexContent>
 >             <xs:restriction base="A">
 >             <xs:sequence>
 >                 <xs:element name="f"/>
 >                 <xs:choice>
 >                     <xs:element name="a"/>
 >                     <xs:element name="b1"/>
 >                 </xs:choice>
 >            </xs:sequence>
 >           </xs:restriction>
 >         </xs:complexContent>
 >     </xs:complexType>
 
 Just looking at it, I don't think so. Under a restriction, it
 shouldn't be possible to come up with a content model that's valid for
 the restricted type but isn't valid for the base type, and it is
 possible in this case:
 
   <f />
   <b1 />
 
 is valid for B, but isn't valid for A (in A, every b1 must be preceded
 by an a1).
 
 Cheers,
 
 Jeni
 
 ---
 Jeni Tennison
 http://www.jenitennison.com/
 
 

Received on Monday, 22 July 2002 13:54:32 UTC