You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2002/01/24 11:02:38 UTC

DO NOT REPLY [Bug 6001] New: - DOM parser does not stop to allocate memory and starves when it validates against a XML schema which uses a xsd:choice with maxOccurs="4000"

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=6001>.
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=6001

DOM parser does not stop to allocate memory and starves when it validates against a XML schema which uses a xsd:choice with maxOccurs="4000" 

           Summary: DOM parser does not stop to allocate memory and starves
                    when it validates against a XML schema which uses a
                    xsd:choice with maxOccurs="4000"
           Product: Xerces-C++
           Version: 1.6.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: Validating Parser (Schema) (Xerces 1.5 or up only)
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: helmut.reis@frequentis.at


When the following XML is validated against the XML schema below, i.e. with 
DOMPrint, the DOM parser starts to allocate memory and starves.

<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XML Spy v4.2 U (http://www.xmlspy.com)-->
<A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation=".\bug.xsd">
<rB>
	<B1 id="123"/>
	<B2 id="123"/>
	<B1 id="123"/>
</rB>
</A>

<?xml version="1.0" encoding="UTF-16"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="A">
<xsd:complexType>
<xsd:all>
<xsd:element name="rB">
<xsd:complexType>
<xsd:choice minOccurs="0" maxOccurs="4000">
	<xsd:element name="B1">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:string"/>
		</xsd:complexType>
	</xsd:element>
	<xsd:element name="B2">
		<xsd:complexType>
			<xsd:attribute name="id" type="xsd:string"/>
		</xsd:complexType>
	</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:schema>

The problem seems to be the xsd:choice element with maxOccurs set to a value 
above 1000. Note that this is only a simple example which reproduces the 
behaviour. It is not an acceptable workaround to set maxOccurs to unbounded.

Do you solve this in further release of the parser?

With kind regards
Helmut Reis

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