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

RE: enumerations

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Fri, 15 Feb 2002 10:49:12 -0800
Message-Id: <8904C60CACA7D51191BC00805FEAAF4358EAEB@crdc-exch-7.crdc.kp.org>
To: "'Eamon.Galavan@risk.sungard.com'" <Eamon.Galavan@risk.sungard.com>, xmlschema-dev@w3.org
> -----Original Message-----
> From:	Eamon.Galavan@risk.sungard.com [SMTP:Eamon.Galavan@risk.sungard.com]
> Sent:	Thursday, February 14, 2002 9:37 AM
> To:	xmlschema-dev@w3.org
> Subject:	enumerations
> How do I implement enumerations in Schemas?
without more detail, its hard to know exactly what your question means, but
I'll take a stab...if this isn't your question, please repost with more

In DTD's one can say:

	<!ELEMENT elem (#PCDATA)>
	<!ATTLIST elem attr (enum1 | enum2 | enum3) #IMPLIED>

You can accomplish the same in schema with:

	<xs:element name='elem'>
		<xs:complexType mixed='true'>
			<xs:attribute name='attr'>
					<xs:restriction base='xs:NMTOKEN'>

Received on Friday, 15 February 2002 14:00:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:55 UTC