Results 1 to 4 of 4

Thread: XML Schema Enum

  1. #1

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339

    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.

  2. #2
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    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>

  3. #3

    Thread Starter
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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.

  4. #4
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    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
  •  



Click Here to Expand Forum to Full Width