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

[PR] resolve defaulted QName identity fields against the schema [poi-xmlbeans]

pjfanning opened a new pull request, #143:
URL: https://github.com/apache/poi-xmlbeans/pull/143

   Follow-up to #141.
   
   `Validator` passes a defaulted or fixed attribute to the identity constraint engine as its default *text*. Since #141, a QName value is built with the instance's in-scope namespaces. But the prefix in a schema default was declared in the schema, so the value either fails to resolve (prefix unbound in the instance: the field is left unfilled) or resolves to the wrong namespace (prefix rebound in the instance: false duplicates or missed keyref matches).
   
   `IdentityConstraint.defaultAttr` now takes the `SchemaLocalAttribute`. `FieldState` uses `getDefaultValue()`, which resolves against the schema, and calls it only when a field XPath matches. The ID/IDREF states keep using the default text, which carries no prefixes.
   
   `QNameIdentityConstraintValidateTest` now runs every case through both `XmlObject.validate()` and `ValidatingXMLStreamReader`, and adds:
   - an element-text field (`xs:field xpath='t:v'`), covering the `text()` path from #141
   - a default-namespace QName matching a prefixed one, plus an unprefixed QName with no default namespace staying distinct
   - defaulted QNames whose schema prefix is unbound in the instance, or bound to a different namespace there
   - an exact error count for the dangling keyref case
   
   Without the main change, the 4 defaulted-QName cases fail. `./gradlew test` passes (3242 tests).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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 defaulted QName identity fields against the schema [poi-xmlbeans]

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


-- 
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