title: Condition based on attribute value (XML Schema)
body: <p>Is it possible to define in XML Schema an condition based on attribute value? For example, when <code>test@attrib="one"</code>, I want <code>one-element</code> to be allowed and mandatory or when <code>test@attrib="two"</code>, I want <code>two-element</code> to be allowed and mandatory.</p>
  
  <p>For example, valid documents are:</p>
  
  <pre><code>&lt;root&gt;
      &lt;test attrib="one"/&gt;
      &lt;some-element-1/&gt;
      &lt;some-element-2/&gt;
      ...
      &lt;some-element-n/&gt;
      &lt;one-element&gt;
      &lt;/one-element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;root&gt;
      &lt;test attrib="two"/&gt;
      &lt;some-element-1/&gt;
      &lt;some-element-2/&gt;
      ...
      &lt;some-element-n/&gt;
      &lt;two-element&gt;
      &lt;/two-element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Wrong documents:</p>
  
  <pre><code>&lt;root&gt;
      &lt;test attrib="one"/&gt;
      &lt;some-element-1/&gt;
      &lt;some-element-2/&gt;
      ...
      &lt;some-element-n/&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&lt;root&gt;
      &lt;test attrib="two"/&gt;
      &lt;some-element-1/&gt;
      &lt;some-element-2/&gt;
      ...
      &lt;some-element-n/&gt;
      &lt;one-element&gt;
      &lt;/one-element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Is it possible in XSD?</p>