Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Element Takes Enumerated List but has Attribute that Takes a String

From: "Fortuno, Adam" <Adam_Fortuno@----------.--->
To: <xmlschema-dev@--.--->
Date: 12/15/2006 9:26:00 AM
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


From mike@s... Tue Dec 19 14:57:37 2006
Received: from lisa.w3.org 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent