aizu-m opened a new pull request, #141:
URL: https://github.com/apache/poi-xmlbeans/pull/141

   Validating against a schema whose `xs:unique`/`xs:keyref` field is an 
`xs:QName`, with `xmlns:p='urn:p'` on the root:
   
       <t:k n='p:a'/><t:k n='p:a'/>      xs:unique   validate(): true   
(expected cvc-identity-constraint.4.1)
       <t:k n='p:a'/><t:ref n='p:zzz'/>  xs:keyref   validate(): true   
(expected cvc-identity-constraint.4.3)
       <t:k n='p:a'/><t:ref n='p:a'/>    xs:key      error: Key kk@urn:t is 
missing field with xpath: '@n'
   
   Found while auditing the validator for constraint checks that an instance 
can slip past. Unprefixed QNames behave. Prefixed ones do not.
   
   `IdentityConstraint.FieldState.attr` and `FieldState.text` build each field 
value with `st.newValue(value)`. No `NamespaceContext` is pushed, so the prefix 
cannot be resolved. `newValue` throws, the helper swallows it and returns null, 
and the field is treated as unfilled. The value never enters the node table. 
Duplicates and dangling keyrefs go unreported, and a valid document using 
`xs:key` is rejected.
   
   The `Event` passed in is already a `PrefixResolver`. `Validator` pushes `new 
NamespaceContext(event)` before `newValue` for union enumerations. This does 
the same at the two field-value sites. The ID/IDREF paths are unchanged.
   
   Same result through `ValidatingXMLStreamReader`. Added 
`QNameIdentityConstraintValidateTest`. All three cases fail before the change 
and pass after. `./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]

Reply via email to