[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Element Takes Enumerated List but has Attribute that Takes a String

From: Fortuno, Adam <Adam_Fortuno@ghrsystems.com>
Date: Fri, 15 Dec 2006 14:25:46 -0500
Message-ID: <CED447ECB4C001419947EBF4776E503282EC65@ghrintallmsg2.CORPORATE.GHRSYS.AD>
To: <xmlschema-dev@w3.org>
Element Takes Enumerated List but has Attribute that Takes a String

All,

I'm trying to create the below structure

<Foo _Code="XYZ">ABC</Foo>

Where the element `Foo` takes a literal value from an enumerated list,
and the attribute `_Code` takes a (xs:)string. I have tried a few
different constructs based on research I've done. I can get the
enumerated list for the element but not the attribute or vice versa. 

Any suggestions would be appreciated. Here is what I've tried (doesn't
work).

	<xs:element name="Foo" type="FooType">
		<xs:complexType>
			 <xs:attribute name="_Code" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	 <xs:simpleType name="FooType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="ABC" />
			<xs:enumeration value="123" />
			<xs:enumeration value="DEF" />
		</xs:restriction>
	 </xs:simpleType>

Regards,
Adam
Received on Tuesday, 19 December 2006 14:31:47 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.