Uploaded image for project: 'Xerces2-J'
  1. Xerces2-J
  2. XERCESJ-1580

Out of memory while validating an XML instance with a schema that contains particles with a large maxOccurs

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      I obtain an OutOfMemory exception when i validate the XML instance "test.xml" with the schema "test.xsd".

      You can reproduce the issue on the xml-schema-1.1-dev branch, using the jaxp.SourceValidator as follows:
      jaxp.SourceValidator -xsd11 -a test.xsd -i test.xml

      Please note that this exception occurs only if the "full schema checking" feature is disabled.

      XML instance: test.xml
      <doc>
      <a/>
      <b/>
      </doc>

      Schema: test.xsd

      <xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' >
      <xsd:complexType name='fooType' >
      <xsd:choice maxOccurs="100000">
      <xsd:sequence maxOccurs="100000000">
      <xsd:element name='a' maxOccurs="unbounded"/>
      </xsd:sequence>
      <xsd:element name="b"/>
      </xsd:choice>
      </xsd:complexType>
      <xsd:element name="doc" type="fooType"/>
      </xsd:schema>

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              octavian.nadolu Octavian Nadolu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: