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

minOccurs

From: Frédéric Jaouën <Frederic.Jaouen@accovia.com>
Date: Mon, 26 Aug 2002 18:09:05 -0400 (EDT)
Message-ID: <3D6AA6E9.91C9A800@accovia.com>
To: xmlschema-dev@w3.org
CC: "A_ACCOVIA !" <Frederic.Jaouen@accovia.com>
Hello,

I have a question about minOccurs !

I have define a group "groupA" which contains 3 optional elements.

Is that correct to make a reference without specifying a minOccurs="0"
in my definition of "testMin" element even though all elements in
"groupA" are all optional ?

Even though it is probably not very nice, I understand in the W3C that
it can be done and I should be able to validate it !

RIGHT ???

<xs:group name="groupA">
  <xs:sequence>
   <xs:element name="A" minOccurs="0">
    <xs:simpleType>
     <xs:restriction base="S">
      <xs:maxLength value="64"/>
     </xs:restriction>
    </xs:simpleType>
   </xs:element>
   <xs:element name="B" minOccurs="0">
    <xs:simpleType>
     <xs:restriction base="S">
      <xs:maxLength value="32"/>
     </xs:restriction>
    </xs:simpleType>
   </xs:element>
   <xs:element name="C" minOccurs="0">
    <xs:simpleType>
     <xs:restriction base="S">
      <xs:maxLength value="32"/>
     </xs:restriction>
    </xs:simpleType>
   </xs:element>
  </xs:sequence>
 </xs:group>

 <xs:element name="testMin">
  <xs:complexType>
   <xs:sequence>
    <xs:group ref="groupA"/>
    <xs:group ref="groupB"/>
   </xs:sequence>
  </xs:complexType>
 </xs:element>

"groupB" maybe anything.

Thanks !

Frédéric Jaouën



Received on Tuesday, 27 August 2002 04:12:24 GMT

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