title: Choice of Attribute(s) on XML instance for directly defined attributes or references
body: <p>I'm looking for a variant of choosing an attribute for an element, that can be directly set or be referenced. </p>
  
  <p>this is what I have in Mind:</p>
  
  <pre><code>&lt;root&gt;    
  &lt;element&gt;
     &lt;attribute ref="shortname" /&gt;
  &lt;/element&gt;
  &lt;element&gt;
     &lt;attribute name="shortname" isEditable="true" anotherattrib="0815" /&gt;
  &lt;/element&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>Since this wouldn't be problem without an xml scheme, the definition of this attribute is quite hard if attribute "name" of element attribute is required. </p>
  
  <p>the scheme could look like this</p>
  
  <pre><code>&lt;xs:element name="attribute"&gt;
  &lt;xs:complexType&gt;
  &lt;xs:attribute name="ref" use="required" /&gt;
  &lt;xs:attribute name="name" use="required" /&gt;
  &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>Is there any possibility to make a choice ( similar to a xs:choice for elements ) between attributes? Like if there is an attribute from element attribute named ref, no other attributes are allowed. if not, the attribute "name" must be set...</p>
  
  <p>This problem sounds pure virtual and academic but I would be happy if there might be a solution or if I'm completely wrong with what I have in mind :)</p>
  
  <p>Thank you in advance for any help!</p>
  
  <p>Dave</p>