JDK-6974511 : The values of minOccurs and maxOccurs attributes are limited to the value 2147483647.
  • Type: Bug
  • Component: xml
  • Sub-Component: org.xml.sax
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2010-08-04
  • Updated: 2013-12-02
  • Resolved: 2011-08-30
Related Reports
Duplicate :  
Description
The values of minOccurs and maxOccurs attributes are limited to the value 2147483647 although according to the spec:

  maxOccurs = (nonNegativeInteger  | unbounded)  : 1
  minOccurs = nonNegativeInteger : 1
  and nonNegativeInteger <= +123456789012345678901234567890. 

It contradicts the specification: XML Schema Part 1: Structures Second Edition

Attached JCK test tast fails due this limitation with exception:

SAX error: file:/analysis/addB099.xsd(21,78): s4s-att-invalid-value: Invalid attribute value for 'minOccurs' in element 'group'. Recorded reason: cvc-datatype-valid.1.2.1: '12678967543233' is not a valid value for 'nonNegativeInteger'.

Also the recorder reason looks weird: '12678967543233' is not a valid value for 'nonNegativeInteger'

Comments
EVALUATION Refer to https://issues.apache.org/jira/browse/XERCESJ-859 Quote: We still don't support all legal nonNegativeInteger/positiveIntegers for certain attributes (e.g. length, minLength, maxLength, minOccurs, maxOccurs, etc.). The reason is that for these properties, we store the values as "int" internally. But considering how unlikely it is for these values to be greater than 2G, and how difficult/inefficient it would be if we use something like BigDecimal, we decided to leave it as a limitation. I would think this is legit argument. I would suggest excluding the test from the JCK. Would you agree? I'm sending the issue back to you for review.
30-08-2011