W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2001

Re: Is this valid schema??

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 20 Mar 2001 14:12:04 +0000
To: Ayalew Kassahun <A.Kassahun@InfoRay.NL>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bvgp4o7gr.fsf@cogsci.ed.ac.uk>
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 GMT

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