title: How to make child element attributes required based on parent element attribute in xsd
body: <p>In below example of XSD what i want is if "Faron" element has the "TestMethod" attribute = 1 then the child element
  faronsettings must have attribute "test1" and with value.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
  &lt;xs:element name="Faron"&gt;
  &lt;xs:complexType&gt;
    &lt;xs:sequence&gt;
      &lt;xs:element maxOccurs="unbounded" name="Application"&gt;
        &lt;xs:complexType&gt;
          &lt;xs:sequence&gt;
            &lt;xs:element name="FaronSettings"&gt;
              &lt;xs:complexType&gt;
                &lt;xs:attribute name="test1" type="xs:string" use="optional" /&gt;
                &lt;xs:attribute name="test2" type="xs:string" use="optional" /&gt;
                &lt;xs:attribute name="test3" type="xs:string" use="optional" /&gt;
                &lt;xs:attribute name="test4" type="xs:string" use="optional" /&gt;
              &lt;/xs:complexType&gt;
            &lt;/xs:element&gt;
          &lt;/xs:sequence&gt;
          &lt;xs:attribute name="TestMethod" type="TestType" use="required" /&gt;
        &lt;/xs:complexType&gt;
      &lt;/xs:element&gt;
    &lt;/xs:sequence&gt;
  &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  &lt;xs:simpleType name="TestType"&gt;
  &lt;xs:restriction base="xs:string"&gt;
    &lt;xs:minLength value="1" /&gt;
    &lt;xs:enumeration value="1"/&gt;
    &lt;xs:enumeration value="2"/&gt;
    &lt;xs:enumeration value="3"/&gt;
    &lt;xs:enumeration value="4"/&gt;
  &lt;/xs:restriction&gt;
   &lt;/xs:simpleType&gt;
  &lt;/xs:schema&gt;
  </code></pre>