Guys.
I have a following XSD parts:
<!-- Enumeration of supported types -->
<xs:simpleType name="SupportedTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="creditCard" />
<xs:enumeration value="directDebit" />
<xs:enumeration value="paypal" />
<xs:enumeration value="webmoney" />
</xs:restriction>
</xs:simpleType>
This works perfectly when I want to check the attributes values for instace (XSD below):
<!-- this is what I know how to make, not what I want to do :) -->
<xs:element name="PaymentType" type="SupportedTypes" />
But what if I have a list of payment types, e.g. (XML below):
<!-- existing XML that I need to validate (preferably by the same enum) -->
<paymentTypes>
<creditCard price="123.50" />
<webmoney price="100.00" />
<directDebit never="true" />
</paymentTypes>
Is there a way to check the tag names agains an existing SupportedTypes
type?
Cheers!