title: XSD: Can I make an element inherit an ancestor's rules?
body: <p>Consider the following:</p>
  
  <pre><code>&lt;xs:complexType name="A"&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:group ref="subAGroup"/&gt;
          &lt;xs:group ref="xGroup"/&gt;
      &lt;/xs:choice&gt;
  &lt;/xs:complexType&gt;
  &lt;xs:complexType name="B"&gt;
      &lt;xs:choice minOccurs="0" maxOccurs="unbounded"&gt;
          &lt;xs:group ref="subBGroup"/&gt;
          &lt;xs:group ref="xGroup"/&gt;
      &lt;/xs:choice&gt;
  &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>What I want to happen is if one of the elements in the xGroup is a child, grandchild, etc. of A then its children must be part of the subAGroup or xGroup.  If B is its ancestor then its children must be in the subBGroup or xGroup.</p>