aizu-m opened a new pull request, #151:
URL: https://github.com/apache/poi-xmlbeans/pull/151
Differential run, XmlObject.validate() against the JDK Xerces validator,
schema with `<xs:any processContents='lax'/>` and no global declaration for `u`:
<u xsi:type='t:small'>9</u> xmlbeans: valid xerces:
cvc-maxInclusive-valid
<u xsi:type='t:ct'><z>x</z></u> xmlbeans: valid xerces:
cvc-datatype-valid.1.2.1
<u xsi:type='t:missing'/> xmlbeans: valid xerces:
cvc-elt.4.2
strict: <u xsi:type='t:small'>3</u> xmlbeans:
cvc-assess-elt.1.1.1.3.2 xerces: valid
How it was found: a differential run of wildcard schemas through both
validators. 13 lax and 3 strict disagreements over 18 instance variants.
Observation: when a lax or strict wildcard matches a name with no global
declaration, Validator.beginEvent sets `_eatContent` and returns before it
reads xsi:type. Lax skips the element silently, whatever its content. Strict
reports it as unresolved, even when the xsi:type content is valid.
Conclusion: cvc-assess-elt.1.2 assesses an element with no declaration
against its xsi:type when that resolves. The xs:any definition says strict
needs a top-level declaration or an xsi:type. The validator only implements the
first route.
Fix: with no declaration but an xsi:type present, carry on with xs:anyType
as the declared type. The existing xsi:type resolution, derivation and block
checks then run unchanged. Undeclared elements without xsi:type, and
setValidateTreatLaxAsSkip, behave as before. XmlObject.validate() and
ValidatingXMLStreamReader both go through this path.
After the fix the differential run has no disagreements left for these
cases. Regression test added. `./gradlew test` passes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]