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:47:45 UTC