RE: Nested Schema

> -----Original Message-----
> From:	Biron,Paul V 
> Sent:	Friday, February 15, 2002 4:18 PM
> To:	'Martin Gudgin'; xmlschema-dev@w3.org; Sameek Ghosh
> Subject:	RE: Nested Schema
> 
> 	-----Original Message-----
> 	From:	Martin Gudgin [SMTP:marting@develop.com]
> 	Sent:	Wednesday, February 13, 2002 8:57 AM
> 	To:	xmlschema-dev@w3.org; Sameek Ghosh
> 	Subject:	Re: Nested Schema
> 
> 	You need something along these lines;
> 
> 	<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' >
> 	  <xs:element name='Menu' >
> 	    <xs:complexType>
> 	      <xs:sequence>
> 	        <xs:element name='File' type='xs:string' />
> 	        <xs:element name='Edit' type='xs:string' />
> 	        <xs:element ref='Menu' minOccurs='0' /> <!-- note ref and
> 	minOccurs -->
> 	      </xs:sequence>
> 	    </xs:complexType>
> 	  </xs:element>
> 	</xs:schema>
> 
> The following also works:
> 
Opps...hit "send" instead of "paste"...

<xs:element name="Menu" type="Menu"/>
<xs:complexType name="Menu">
	<xs:sequence>
		<xs:element name="File" type="xs:string"/>
		<xs:element name="Edit" type="xs:string"/>
		<xs:element name="Menu" type="Menu" minOccurs="0"/>
	</xs:sequence>
</xs:complexType>

Note: SQC 1.2.1 had a problem with schemas like this (it would blow up with
stack overflow errors)...I reported to to Bob Schloss and, as he promised,
the just released SQC 2.0 handles it just fine!

pvb

Received on Friday, 15 February 2002 19:25:47 UTC