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
following:

<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:simpleType>
			<xs:restriction base="xs:string">
				<xs:enumeration value="integer" />
				<xs:enumeration value="float" />
				<xs:enumeration value="other" />
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
</xs:complexType>

would this do the trick?

thanks!
--saul
-- 
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 GMT

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