I have the following XML Tag
<price currency="euros">20000.00</price>
How do I restrict the currency attribute to one the following:
- euros
- pounds
- dollars
AND the price to a double?
I just get an error when I try to a type on both, here's what I've got so far:
<xs:element name="price">
<xs:complexType>
<xs:attribute name="currency">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="pounds" />
<xs:enumeration value="euros" />
<xs:enumeration value="dollars" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
Best Answer
The numerical value seems to be missing from your price definition. Try the following: