Re: Is this valid schema??

Ayalew Kassahun <A.Kassahun@InfoRay.NL> writes:

> hi list:
> 
> 
> xmlspy allows me to make (it validates) the following schema snipet, but i
> am suspecious about it. Is it allowed to have more than one "PART" element
> that vary only on a value of an attribute in the element RESULT. 
> 
> can someone enlighten me.
> 
> regards,
> ayalew
> 
> 	<xsd:complexType name="RESPONSE">
> 		<xsd:choice>
> 			<xsd:element name="RESULT">
> 				<xsd:complexType>
> 					<xsd:sequence>
> 						<xsd:element name="PART">
> 							<xsd:complexType>
> 	
> <xsd:attribute name="NAME" type="xsd:string" use="fixed" value="HEADER"/>
> 							</xsd:complexType>
> 						</xsd:element>
> 						<xsd:element name="PART">
> 							<xsd:complexType>
> 	
> <xsd:attribute name="NAME" type="xsd:string" use="fixed" value="CONTENT"/>
> 							</xsd:complexType>
> 						</xsd:element>
> 					</xsd:sequence>
> 				</xsd:complexType>
> 			</xsd:element>
> 			<xsd:element name="EXTRA"/>
> 		</xsd:choice>
> 		<xsd:attribute name="NAME"/>
> 	</xsd:complexType>

You're right, this should not be allowed, because the two parts have
different types.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Tuesday, 20 March 2001 09:12:08 UTC