-
XML Schema Enum
Is there a way to set a static enum type list, maybe as a simpleType, in an XML Schema?
So if this is the structure:
<Vault>
<Local>
<Title><\Title>
<Catergory><\Catergory>
<Platform><\Platform>
<\Local>
<\Vault>
I want to have Platform and Catergory be values from a list. It thought that it'd be nice to tie that into the schema, but don't know how.
-
XML is still something that often leaves me scratching my head, but you may want to take a look at:
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemXmlSchemaXmlSchemaEnumerationFacetClassTopic.htm
<?xml version="1.0" encoding="IBM437"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="SizeType">
<xs:restriction base="xs:string">
<xs:enumeration value="Small" />
<xs:enumeration value="Medium" />
<xs:enumeration value="Large" />
</xs:restriction>
</xs:simpleType>
<xs:element name="Item">
<xs:complexType>
<xs:attribute name="Size" type="SizeType" />
</xs:complexType>
</xs:element>
</xs:schema>
-
Thanks I think that is as close as you get to an enum in XML, although it didn't work out like I wanted. Thanks.
I think you know more of the help files than anyone I know, you are a help file quoting machine, which is cool.
-
Thanks! :D Nice to be able to help YOU for once.