Repository navigation
Conversation
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.
Differential run of
XmlObject.validate()against the JDK Xerces validator, same schema and instances:Found while probing the ID/IDREF table with ID and IDREF values reached through list and union types. 16 disagreements, all in the accept direction.
ValidatingXMLStreamReadergives the same results, it shares the engine.IdentityConstraint.IdState.handleValueandIdRefState.handleValueonly enter a value when its type is assignable to xs:ID, xs:IDREF or xs:IDREFS. A list whose items are IDs, a union with an ID member, or a list of such unions is not. The value never reaches the table, so duplicate IDs and dangling references validate clean. XML Schema 1.1 Part 1 3.17.5.2 puts every type derived or constructed from ID, IDREF or IDREFS in the table, and Xerces does the same.The same code recorded an IDREF in a complex type with simple content under the complex type. That never compares equal to an ID, so
<t:id>a</t:id><t:refc>a</t:refc>was rejected with "ID not found". Entries are now built from xs:ID or xs:IDREF, so that document validates.The lookup walks the list items and the union member that accepted the value with
SimpleValue.instanceType()andxgetListValue(), and skips values that are not NCNames (lexically invalid, or belonging to another union member). Directly typed ID, IDREF and IDREFS values behave as before. No disagreement remains after the change, and./gradlew testis green. Regression test added.