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

elements with descriptors

From: Saul Farber <saul@syncline.com>
Date: 06 Dec 2001 12:01:42 -0500
To: xmlschema-dev@w3.org
Message-Id: <1007658102.7695.7.camel@saul>
How would one go about creating schema for an element like the

<me:mydata type="integer">123456</me:mydata>

where the value of the "type" attribute is a restriction?

I think it is as follows, but would like to confirm (or find out that I
am wrong!)

<xs:element name="mydata" type="mydataType" />
<xs:complexType name="mydataType" mixed="true">
	<xs:attribute name="type">
			<xs:restriction base="xs:string">
				<xs:enumeration value="integer" />
				<xs:enumeration value="float" />
				<xs:enumeration value="other" />

would this do the trick?

Syncline, Inc.
373 Washington St.
Boston, MA  02108

617-986-1000 (x248)

www.syncline.com -- Informing the Enterprise
www.mapciti.com -- It's Your Town on the Web

Received on Thursday, 6 December 2001 11:57:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC