title: DTD - attributes with fixed default values
body: <p>Lets say I have a snippet of a DTD declaration like this.</p>
  
  <pre><code>&lt;!ELEMENT book ANY&gt;
  &lt;!ATTLIST book genre #FIXED "fantasy"&gt;
  </code></pre>
  
  <p>Note that the <code>genre</code> attribute was declared with a fixed default value of <code>fantasy</code>.</p>
  
  <p>What exactly is the meaning of such a declaration? Two possible interpretations come to mind:</p>
  
  <ol>
  <li>A document is not valid unless each <code>book</code> element contain a <code>genre</code> attribute with value <code>fantasy</code>.</li>
  <li>A document is valid if each <code>book</code> element either contains a <code>genre</code> attribute with value <code>fantasy</code> or does not contain the <code>genre</code> attribute at all.</li>
  </ol>
  
  <p>I did not find a definitive answer in <a href="http://www.w3.org/TR/REC-xml/" rel="nofollow">the DTD specification</a>, even though the second one seems more likely because of the following part:</p>
  
  <blockquote>
    <p>Validity constraint: Fixed Attribute Default</p>
    
    <p>If an attribute has a default value declared with the #FIXED keyword,
    instances of that attribute MUST match the default value.</p>
  </blockquote>