[ 
https://issues.apache.org/jira/browse/XERCESJ-1579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13476256#comment-13476256
 ] 

Sandy Gao commented on XERCESJ-1579:
------------------------------------

My quick guess (without actually running this test):
- If you change "9999999" to a smaller number (say "5"), then the test would 
work.
- It's not really an infinite loop, instead, Xerces is trying to construct a 
state machine to represent the content model, by expanding maxOccurs to a 
sequence of optional elements. This obviously will take a very long time and a 
lot of memory to accomplish.
- Having to expand big maxOccurs values has been a problem for Xerces. We have 
done something in this area, but we haven't had the time to solve this 
completely. Schema 1.1's new particle restriction rules add one more place 
where this expansion is needed.
- For most of the big maxOccurs cases (unless they are hypothetical tests like 
this one), they can be replaced with "unbounded" without losing much validation 
power, which is why this hasn't become a top priority. A complete solution will 
take many months to develop, and we haven't been able to justify that.

Anyway, this is just my guess. There could be another error that's causing an 
infinite loop, which we should fix. But if it's spending all the time expanding 
maxOccurs, I doubt there's anything we can do in the near future.
                
> Possible infinite loop while validating a schema that contains complex type 
> restrictions
> ----------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1579
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1579
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>            Reporter: Octavian Nadolu
>            Priority: Critical
>
> There seems to be an infinite loop while validating the schema with "full 
> schema checking" and XML Schema 1.1 features, on the xml-schema-1.1-dev 
> branch.
> You can reproduce the issue on the xml-schema-1.1-dev branch, using the 
> jaxp.SourceValidator as follows:
> jaxp.SourceValidator -xsd11 -f -a particlesIe003.xsd
> Schema: particlesIe003.xsd
> {code}
> <?xml version="1.0"?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> targetNamespace="http://xsdtesting"; xmlns:x="http://xsdtesting"; 
> elementFormDefault="qualified">
>       <xsd:complexType name="base">
>               <xsd:choice>
>                       <xsd:element name="e1" minOccurs="0" 
> maxOccurs="unbounded"/>
>                       <xsd:element name="e2" minOccurs="0" 
> maxOccurs="unbounded"/>
>               </xsd:choice>
>       </xsd:complexType>
>       <xsd:complexType name="testing">
>               <xsd:complexContent>
>                       <xsd:restriction base="x:base">
>                               <xsd:choice>
>                                       <xsd:element name="e1" minOccurs="1" 
> maxOccurs="9999999"/>
>                                       <xsd:element name="e2" minOccurs="1" 
> maxOccurs="9999999"/>
>                               </xsd:choice>
>                       </xsd:restriction>
>               </xsd:complexContent>
>       </xsd:complexType>
>       <xsd:element name="doc" type="x:testing"/>
> </xsd:schema>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscr...@xerces.apache.org
For additional commands, e-mail: j-dev-h...@xerces.apache.org

Reply via email to