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

Incorrect values for {validation attempted} property in PSVI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.7.1
    • 2.8.0
    • None

    Description

      schema.xsd:
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <xsd:complexType name="X">
      <xsd:sequence>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:schema>

      doc1.xml:
      <A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <B />
      <C xsi:type="X" />
      </A>

      doc2.xml:
      <A xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <B xsi:type="X" />
      <C />
      </A>

      After validating doc1.xml against schema.xsd, he

      {validation attempted} property of B should be VALIDATION_NONE and C should be VALIDATION_FULL. However, Xerces reports the {validation attempted}

      property of C as VALIDATION_PARTIAL.

      Conversely, when validating doc2.xml against schema.xsd, the

      {validation attempted} property of B should be VALIDATION_FULL and C should be VALIDATION_NONE. However, once again Xerces reports the {validation attempted}

      property of C as VALIDATION_PARTIAL.

      The problem has to do with updating the fNNoneValidationDepth and fNFullValidationDepth in XMLSchemaValidator#handleEndElement(). Currently, the variables are only updated together, but they should actually be updated independently. I'll attach a patch.

      Attachments

        1. val_att_fix.txt
          1 kB
          Peter McCracken

        Activity

          People

            mrglavas@ca.ibm.com Michael Glavassevich
            peterjm Peter McCracken
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: