You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by "aizu-m (via GitHub)" <gi...@apache.org> on 2026/10/20 11:58:25 UTC

[PR] resolve QName field values against the instance in IdentityConstraint [poi-xmlbeans]

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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: [PR] resolve QName field values against the instance in IdentityConstraint [poi-xmlbeans]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning commented on PR #141:
URL: https://github.com/apache/poi-xmlbeans/pull/141#issuecomment-6354175133

   merged - thanks


-- 
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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Re: [PR] resolve QName field values against the instance in IdentityConstraint [poi-xmlbeans]

Posted by "pjfanning (via GitHub)" <gi...@apache.org>.
pjfanning merged PR #141:
URL: https://github.com/apache/poi-xmlbeans/pull/141


-- 
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: dev-unsubscribe@poi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org