J
Justin Wright
I know that I can set up an enumeration as follows ( just typed in quick so
may have syntax errors ):
<xsd:simpleType name="colors">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="red"/>
<xsd:enumeration value="yellow"/>
<xsd:enumeration value="blue"/>
</xsd:simpleType>
However, what I need to do is associate each element of the "colors"
enumeration with an integer as well. For example, a string value of "red"
or an int of 10 should be treated the same:
String int value
red 10
yellow 20
blue 30
Is there any way to assign the int value to the enumeration? Is the "id"
attribute what I should be using? For example:
<xsd:simpleType name="colors">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="red" id="10"/>
<xsd:enumeration value="yellow" id="20"/>
<xsd:enumeration value="blue" id="30"/>
</xsd:simpleType>
Any help would be appreciated!
Thanks,
Justin
may have syntax errors ):
<xsd:simpleType name="colors">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="red"/>
<xsd:enumeration value="yellow"/>
<xsd:enumeration value="blue"/>
</xsd:simpleType>
However, what I need to do is associate each element of the "colors"
enumeration with an integer as well. For example, a string value of "red"
or an int of 10 should be treated the same:
String int value
red 10
yellow 20
blue 30
Is there any way to assign the int value to the enumeration? Is the "id"
attribute what I should be using? For example:
<xsd:simpleType name="colors">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="red" id="10"/>
<xsd:enumeration value="yellow" id="20"/>
<xsd:enumeration value="blue" id="30"/>
</xsd:simpleType>
Any help would be appreciated!
Thanks,
Justin