Skip to content

Conversation

@dyedgreen
Copy link

Closes #192

@dyedgreen
Copy link
Author

dyedgreen commented Dec 10, 2025

Some notes:

  • The tests don't pass unless I specifically add a namespace to the reference.xsd
  • It seems like it can find the type, but it doesn't succeed at narrowing the allowed set of values in the enum

I haven't quite figured out why. I suspect it's somewhere in the apply facet logic. (It seems like it only ever adds to the enum list?)

@dyedgreen
Copy link
Author

@Bergmann89 happy for you to take a stab at fixing this up as well if you want / or if the issue is obvious to you. (Otherwise I'll try to dig into it a bit more once I have more time later this week.)

@Bergmann89
Copy link
Owner

Ok, I'll have a look tomorrow :)

@Bergmann89
Copy link
Owner

Hey @dyedgreen,

I went through your PR and dug deeper into xs:redefine and xs:override. It turns out the situation is more complex than it first looked. We do need to load the referenced schema during parsing - that part is straightforward - but the real issue is that a redefined/overridden type doesn’t replace the original globally. It only applies within the schema doing the redefine (and any schema that includes it). Other schemas that include the original file continue to use the unchanged type. That means we can end up with multiple definitions of the same QName within one namespace, which xsd-parser can’t currently represent.

@main-- ran into the same issue and opened PR #186 to address it. Before we can fully support xs:redefine and xs:override, we’ll need to merge that PR so types are tracked per namespace and schema rather than just per namespace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for xs:redefine

2 participants