I search for a way to check with my xsd that, a certain tag only one of different allowed strings contains.
E.g. two allowed strings are:
OK:
<TYPE>Index</TYPE>
<TYPE>Condition</TYPE>
WRONG:
<TYPE>Integer</TYPE>
The definition from type in my xsd is as follows:
<xs:element name="TYPE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Use xs:enumeration
:
<xs:element name="TYPE">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:enumeration value="Index"/>
<xs:enumeration value="Condition"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With