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

xsd:group and minOccurs

From: Gregory M. Messner <gmessner@breezefactor.com>
Date: Wed, 28 Aug 2002 02:18:59 -0400 (EDT)
Message-ID: <B181E96D7A30D411A12600A0CCE475DE0F92AE@breezefactor.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>




I'm trying to get a definitive interpretation of the use of minOccurs
attribute and an xsd:group reference.  The only thing I could find in the
specification is at http://www.w3.org/TR/xmlschema-1/#element-group and it
was a little unclear.

I have an xsd:group defined with a sequence of optional elements as follows:

<xsd:group name="agroup">
	<xsd:sequence>
   		<xsd:element name="A" minOccurs="0" type="xsd:string">
		<xsd:element name="B" minOccurs="0" type="xsd:string">
		<xsd:element name="C" minOccurs="0" type="xsd:string">
	</xsd:sequence>
</xsd:group>

And a reference to it as follows:

<xsd:element name="test">
	<xsd:complexType>
   		<xsd:sequence>
			<xsd:element name="foo" minOccurs="0"
type="xsd:string">
    			<xsd:group ref="agroup"/>
    		</xsd:sequence>
  	</xsd:complexType>
</xsd:element>


Since the "agroup" reference in the "test" element has an implied
minOccurs="1" would a document with an empty "test" element be valid against
the schema?
Received on Wednesday, 28 August 2002 11:23:56 GMT

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