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

Validation for XML Schema 1.1 never fnishes (ends up in infinite loop)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • 2.11.0
    • None
    • None

    Description

      If I validate in 1.1 mode a certain XML Schema, the validation never finishes.

      The XML Schema is below:

      ---------------------------------
      <?xml version="1.0"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="a"
      xmlns:a="a">

      <!--
      Test Case Type: Valid test
      Description : Tests openContent in complexType derived by restriction
      -->

      <defaultOpenContent mode="suffix">
      <any processContents="lax"/>
      </defaultOpenContent>

      <!-- it looks like right now the restriction doesn't have base openContent wildcard but will now have the defaultOC WC -->

      <complexType name="c">
      <openContent >
      <any processContents="lax"/>
      </openContent>
      <all>
      <element name="x" type="integer"/>
      <element name="y" type="integer"/>
      </all>
      </complexType>

      <complexType name="d">
      <complexContent>
      <restriction base="a:c">
      <all>
      <element name="x" type="integer"/>
      <element name="y" type="integer"/>
      </all>
      </restriction>
      </complexContent>
      </complexType>

      <element name="root">
      <complexType>
      <sequence>
      <element name="p" type="a:d"/> <!-- tests openContent -->
      </sequence>
      </complexType>
      </element>

      </schema>
      ----------------------------------

      In the method:

      org.apache.xerces.impl.xs.models.XS11CMRestriction.matchWildcardInBase()

      the code:

      while (!emptyWildcard() && (wd1 = derived.nextWildcardTransition(d, dn, idx)) != null) {

      loops endlessly when wd1 and wd are both anyType.

      Attachments

        Activity

          People

            Unassigned Unassigned
            radu_coravu Radu Coravu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified