[ 
http://issues.apache.org/jira/browse/XERCESJ-1070?page=comments#action_12313209 
] 

Michael Glavassevich commented on XERCESJ-1070:
-----------------------------------------------

The only problem I see here is with the error message. The description of 
SecurityManager.setMaxOccurNodeLimit(int) says: Sets the limit of the number of 
content model nodes that may be created when building a grammar for a W3C XML 
Schema that contains maxOccurs attributes with values other than "unbounded". 
(Unfortunately you won't find that in the Javadocs for Xerces 2.6.2 but it's 
there in the source code.) Rather than a limit on maxOccurs, it's a limit on 
the number of nodes which may be created for representing the content model of 
a given type. CMNodeFactory counts the number of nodes it has created and when 
it hits the limit it reports a fatal error.  
 
Rather than the error message saying "Current configuration of the parser 
doesn't allow a maxOccurs attribute value to be set greater than the value {0}" 
or "Current configuration of the parser doesn't allow maxOccurs attribute 
values in a schema to sum to greater than {0}", it should probably say 
something like "Current configuration of the parser doesn't allow the expansion 
of a content model for a complex type to contain more than {0} nodes".

> Error when maxOccurs greater than that enforced by security manager is 
> incorrect.
> ---------------------------------------------------------------------------------
>
>          Key: XERCESJ-1070
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1070
>      Project: Xerces2-J
>         Type: Bug
>   Components: XML Schema Structures
>     Versions: 2.6.2
>     Reporter: David Sheldon
>     Priority: Minor
>  Attachments: maxOccurs-total.xsd, maxOccurs.patch, maxOccurs1001.xsd
>
> We have enabled the security manager, limiting the number of maxOccurs to 
> 3000.
> Xerces says
> "Current configuration of the parser doesn't allow a maxOccurs attribute value
> to be set greater than the value 3,000" 
> This is misleading on two counts. 
>   1. This error is reported if maxOccurs for a particular element is set to 
> 1001 (not 3001).
>   2. It is also reported if the sum of the maxOccurs across many elements in 
> the schema is 
>    greater than 1000.
> The first of these appears to be caused by inconsistancy in CMNodeFactory:
>   private static final int MULTIPLICITY = 1 ;
> ...
>   //we are setting the limit of number of nodes to 3times the maxOccur value..
>   if(fSecurityManager != null){
>      maxNodeLimit = fSecurityManager.getMaxOccurNodeLimit() * MULTIPLICITY ;
>   }
> I'm guessing that MULTIPLICITY should be 3.
> The second of these will require rewording the error message. How about 
> "Current configuration of the parser doesn't allow maxOccurs attribute values 
> in a schema
> to sum to greater than 3,000." 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to