You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/05/08 16:39:26 UTC

DO NOT REPLY [Bug 8907] New: - Parser validation error

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8907>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8907

Parser validation error

           Summary: Parser validation error
           Product: Xerces2-J
           Version: 2.0.1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: SAX
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: rudolf.beez@siemens.com
                CC: rudolf.beez@siemens.com


With your latest version of Xerces-J 2.0.1 (and even older version) I get the 
stack overflow error exception during validation

java.lang.StackOverflowError
 at org.apache.xerces.validators.common.Grammar.buildSyntaxTre(Grammar.java:819)
 at org.apache.xerces.validators.common.Grammar.buildSyntaxTre(Grammar.java:856)
 at org.apache.xerces.validators.common.Grammar.buildSyntaxTre(Grammar.java:856)

The error occures if my XML schema is bounded with maxOccurs >= 5000.
The XML reader can validate the same source document with maxOccurs = 3000
or maxOccurs = unbound without any problem. 
I tried it also with JDom-b8 (for SAX and DOM) but I could see the same 
behavoir.


XML Schema:
-----------

<?xml version="1.0" encoding="UTF-8"?>
  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="Parser-test">
    <xs:annotation>
      <xs:documentation>This xsd should  investigate the behaviour of the 
Xerces parser with high numbers of occurences in a complex 
element</xs:documentation>
    </xs:annotation>
    <xs:complexType>
      <xs:sequence>
        <xs:element name="complex_type" maxOccurs="10000">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Element_1"/>
              <xs:element name="Element_2"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

XML source document:
--------------------

<?xml version="1.0" encoding="UTF-8"?>
<Parser-test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="schema.xsd">
	<complex_type>
		<Element_1>Text</Element_1>
		<Element_2>Text</Element_2>
	</complex_type>
</Parser-test>

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