title: XSD Element Dependency Restrictions
body: <p>I'm not sure XSD has this ability, but if it does I can't figure out how to do it. When submission type is "submit_one", reports can only have the values A, B, or C. When the submission type is "submit_two", reports can only have the values X, Y, or Z. How can I represent this in an XML Schema Definition file?</p>
  
  <p>These would both be valid XML files using this Schema.</p>
  
  <pre><code>&lt;submission type="submit_one"&gt;
     &lt;reports&gt;
        &lt;report&gt;A&lt;/report&gt;
        &lt;report&gt;B&lt;/report&gt;
     &lt;/reports&gt;
  &lt;/submission&gt;
  
  &lt;submission type="submit_two"&gt;
     &lt;reports&gt;
        &lt;report&gt;X&lt;/report&gt;
        &lt;report&gt;Y&lt;/report&gt;
     &lt;/reports&gt;
  &lt;/reports&gt;
  </code></pre>
  
  <p>This would not be a valid xml</p>
  
  <pre><code>&lt;submission type="submit_one"&gt;
     &lt;reports&gt;
        &lt;report&gt;X&lt;/report&gt;
        &lt;report&gt;Z&lt;/report&gt;
     &lt;/reports&gt;
  &lt;/submission&gt;
  </code></pre>