Repository navigation
build the complete attribute wildcard of restrictions from their attribute groups - #168
Merged
Merged
Conversation
…ibute groups A restriction dropped any attribute wildcard that came only from its attribute groups: the inherited-wildcard reset at the end of translateAttributeModel also ran for every attribute group, and for the type itself when it had no anyAttribute of its own. Each wildcard was also checked against the base type's wildcard on its own, so a group wildcard wider than the base failed even when the combined wildcard was a subset. Restrictions now build the complete wildcard like extensions do (XML Schema 1.0 3.4.2): the type's own anyAttribute and its attribute group wildcards are intersected, and derivation-ok-restriction.4 is checked once against the complete wildcard. processContents comes from the type's own anyAttribute, or else from the first attribute group wildcard, as Xerces does. XmlOptions.setCompileLegacyAttributeWildcards() restores the pre-6.0.0 handling, including the union of a type's own wildcards that apache#167 replaced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pjfanning
added a commit
that referenced
this pull request
Nov 16, 2026
Since #168 a restriction's attribute wildcard takes processContents from its own anyAttribute, so Any2LocalT's ##local wildcard is strict rather than the base type's skip. No global no-namespace attribute is declared, so an unqualified attribute is not resolved, as Xerces also reports. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pjfanning
added a commit
that referenced
this pull request
Nov 16, 2026
Only the XSD files were inputs, so a change to the schema compiler in src/main/java reused stale generated sources from the build cache. That hid the AttrWCRestriction failure from #168 locally while CI, without a cache, reported it. The test SchemaGen tasks now also depend on bootstrapMigrate, which builds the compiler classes they run, and the sEXT classpath keeps the task dependencies of the main source set output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #167, which fixed the complete attribute wildcard (XML Schema 1.0 3.4.2) for plain complex types and extensions but left restrictions as they were.
Restriction bug. At the end of
translateAttributeModel, a restriction with noanyAttributeresets the inherited wildcard. That reset also ran at the end of each attribute group's recursive call, and for the type itself when the wildcard came only from groups. Soended up with no attribute wildcard at all, and
urn:a/urn:battributes were rejected. Each wildcard was also checked against the base type's wildcard on its own. A group wildcard wider than the base therefore failedderivation-ok-restriction.4.2, even when the combined wildcard was a subset.Fix. Restrictions now build the complete wildcard the same way extensions do. The type's own
anyAttributeand its attribute group wildcards are intersected, andderivation-ok-restriction.4.1/4.2are checked once, against the complete wildcard.processContentscomes from the type's ownanyAttribute, or else from the first attribute group wildcard, which matches Xerces. The top-level call versus a group's recursive call is now an explicit private overload, instead of #167'sseenAttributes == nullcheck.Opt-out.
XmlOptions.setCompileLegacyAttributeWildcards()(compile time,@since 6.0.0) restores the pre-6.0.0 handling. That covers both the union of a type's own wildcards that #167 replaced and the old restriction behaviour. The attribute model is stored in the compiled type system, so precompiled.xsbjars keep their wildcards either way.AttributeWildcardRestrictionTestcovers:processContentscomes from;🤖 Generated with Claude Code