title: XSD 1.1 structure to enforce unique IDs (if necessary)?
body: <p>Do I need XSD 1.1 to enforce ID uniqueness in a single XML file with a file/record structure like this:</p>
  
  <pre><code>&lt;?xml version="1.1" encoding="UTF-8"?&gt;
  
  &lt;file&gt;
  
  &lt;record id="1" status="ok"&gt;
      &lt;info1&gt;&lt;/info1&gt;
      &lt;info2&gt;&lt;/info2&gt;
      &lt;!-- etc... --&gt;
  &lt;/record&gt;
  
  &lt;record id="2" status="ok"&gt;
      &lt;info1&gt;&lt;/info1&gt;
      &lt;info2&gt;&lt;/info2&gt;
      &lt;!-- etc... --&gt;
  &lt;/record&gt;
  
  &lt;record id="1" status="duplicate_deprecated"&gt;
      &lt;info1&gt;&lt;/info1&gt;
      &lt;info2&gt;&lt;/info2&gt;
      &lt;!-- etc... --&gt;
  &lt;/record&gt;
  </code></pre>
  
  <p></p>
  
  <p>I'd like to also allow certain duplicated IDs under the condition that they are combined with e.g. an attribute meaning "remove / stop using this version of the record, replace this (now) deprecated duplicate by the other record with the same ID" (in the example, record 1).</p>
  
  <p>Is this possible with XML schema 1.0 or does it need XSD 1.1 assertions (etc.)?</p>
  
  <p>What kind of general XML instance structure is needed to make this assertion work? I know that XSD 1.1 asserts need to be on closely related elements / attributes.</p>
  
  <p>Possibly related:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/12496989/asserting-element-id-uniqueness-globally-with-xml-1-1-schema">Asserting element Id uniqueness globally with XML 1.1 schema</a></li>
  <li><a href="https://stackoverflow.com/questions/34532872/xsd-unique-elements-and-attributes">XSD unique elements and attributes</a></li>
  </ul>