title: W3C XML Schema and the maximum integer for maxOccurs
body: <p>I work on a W3C XML Schema (not written by me). One tool, xmllint,
  refuses to use the schema:</p>
  
  <pre><code>traceroute.xsd:658: element element: Schemas parser error : Element
   '{http://www.w3.org/2001/XMLSchema}element', attribute 'maxOccurs': The value
   '4294967295' is not valid. Expected is '(xs:nonNegativeInteger | unbounded)'.
  </code></pre>
  
  <p>4294967295 is 2^32-1 so, clearly, xmllint implements integers with
  signed 32bits number and that's not enough.</p>
  
  <p>Is xmllint right? The standard apparently does not limit the size of
  integers:</p>
  
  <p><a href="http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#p-max_occurs" rel="nofollow noreferrer">http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#p-max_occurs</a>
  <a href="http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#nonNegativeInteger" rel="nofollow noreferrer">http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/datatypes.html#nonNegativeInteger</a></p>
  
  <blockquote>
    <p>The value space of nonNegativeInteger
    is the infinite set {0,1,2,...}.</p>
  </blockquote>
  
  <p>So, implementors are supposed to use infinite integers...</p>
  
  <p>What are the best practices? </p>
  
  <p>Should implementors use bigints or similar things? (In that case,
  xmllint is wrong.)</p>
  
  <p>Should schema authors limit themselves to "reasonable" values for
  maxOccurs? (In that case, I will report the issue to the schema
  authors.)</p>