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

RE: Nested Schema

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Fri, 15 Feb 2002 16:21:03 -0800
Message-Id: <8904C60CACA7D51191BC00805FEAAF4358EAF2@crdc-exch-7.crdc.kp.org>
To: "'Martin Gudgin'" <marting@develop.com>, "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>, "'Sameek Ghosh'" <sameekghosh@vispark.com>
> -----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 GMT

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