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