Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.7.1
-
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.