title: XSD: Complex type that can have either simple content or element context
body: <p>I'm writing an XSD for a rather complex XML file format. At many points, the XML can either contain an actual literal value or a script yielding the value. (Think Excel: <code>42</code> vs. <code>=21+21</code>)</p>
  
  <p>For example, to specify a size, it should be valid to write either of the following:</p>
  
  <pre><code>&lt;size&gt;42&lt;/size&gt;
  &lt;size&gt;&lt;script&gt;2*21&lt;/script&gt;&lt;/size&gt;
  </code></pre>
  
  <p>My first thought was using <code>&lt;choice&gt;</code> to allow either an int or a script within the <code>size</code> element. However, then I would have to give the string element a name, leading to a clumsy syntax like <code>&lt;size&gt;&lt;value&gt;42&lt;/value&gt;&lt;/size&gt;</code>. Since literals will be used far more often than scripts, I don't want to bloat their syntax.</p>
  
  <p>Any ideas how to express the initial syntax in XSD?</p>