|
-
Dec 20th, 2002, 03:16 AM
#1
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.
-
Dec 20th, 2002, 08:25 AM
#2
Fanatic Member
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>
-
Dec 20th, 2002, 12:12 PM
#3
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.
-
Dec 20th, 2002, 05:27 PM
#4
Fanatic Member
Thanks! Nice to be able to help YOU for once.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|