Existing XSD Snippet:
<xs:element name="searchcriteria">
<xs:complexType>
<xs:sequence>
<xs:element ref="filter"
minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="Request"
type="RequestType" />
</xs:complexType>
</xs:element>
<xs:element name="filter">
<xs:complexType>
<xs:sequence>
<xs:element ref="filter"
minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="FieldName"
type="FieldNameType" />
</xs:complexType>
</xs:element>
...
RequestType : Enumeration of 2 values R1 and R2
FieldNameType : Enumeration of 2 values F1, and F2
Now i want to modify this XSD to provide a validation that :
- When RequestType = R1, Then Alowed Fields names are F1 and F2
- When Request Type = R2, Then allowed Fields names are F1, F3 and F4. ( May be a new enumeration is required)
How can i add such validations ? Thanks.