title: XSD Design - One or more rule
body: <p>I am designing a new XSD to capture points information from a business partner. For each transaction the partner must provide a value of points for at least one points type. I have the following:</p>
  
  <pre><code>&lt;xs:element name="Points"&gt;
     &lt;xs:complexType&gt;
        &lt;xs:sequence&gt;
           &lt;xs:element name="SKUPointsQty" type="xs:int" minOccurs="0"/&gt;
           &lt;xs:element name="WelcomePointsQty" type="xs:int" minOccurs="0"/&gt;
           &lt;xs:element name="ManualPointsQty" type="xs:int" minOccurs="0"/&gt;
           &lt;xs:element name="GreenPointQty" type="xs:int" minOccurs="0"/&gt;
        &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
  </code></pre>
  
  <p>The business rules are:</p>
  
  <ul>
  <li>a transaction must provide points from one or more of the points type</li>
  <li>a transaction cannot provide more than one instance of the same points type</li>
  </ul>
  
  <p>What I have so far is not ideal because it would be possible to provide an XML instance without any points. I can't use a choice element because it must be possible to provide an XML instance with more that one points type element. The same point type must not be repeated for a single transaction.</p>
  
  <p>Is it possible to enforce this rule in the design of the XSD?</p>
  
  <p>I have a copy of the excellent XML Schema Companion by Neil Bradley. I can't find the answer in there so I guess it's not possible but thought I'd share the puzzle!</p>
  
  <p>Thanks</p>
  
  <p>Rob.</p>