Fix invalid xs:import of fmi3Annotation.xsd - #8
Open
hubertus65 wants to merge 1 commit into
Open
hubertus65 wants to merge 1 commit into
hubertus65 wants to merge 1 commit into
Conversation
Neither this schema nor fmi3Annotation.xsd declares a targetNamespace, so both are in "no namespace". xs:import is for pulling in components from a different namespace than the importing schema; merging components from a schema with the same (or absent) target namespace is what xs:include is for. Using xs:import without a namespace attribute here is not spec-conformant, and rejected outright by strict validators (e.g. the Python xmlschema library), even though lenient ones (libxml2/xmllint) tolerate it. Closes #7
1 task
Contributor
|
I recommend to merge #10 before merging this to see in the CI that the XML is valid with this fix. |
AnHeuermann
approved these changes
Jul 15, 2026
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.
Summary
maHarmonizedSpecificationExperiments.xsdpulled infmi3Annotation.xsdviaxs:importwith nonamespaceattribute:Neither this schema nor
fmi3Annotation.xsddeclares atargetNamespace— both are in "no namespace". Per XSD 1.0 (§4.2.3),xs:importis for pulling in components from a different namespace than the importing schema; merging components from a schema with the same (or absent) target namespace is whatxs:includeis for.xs:importwithout anamespaceattribute, used by a schema that itself has no target namespace, is not spec-conformant.Lenient validators (libxml2/
xmllint, many IDEs) tolerate this, which is presumably why it went unnoticed, but strict tooling rejects the schema outright — e.g. the Pythonxmlschemalibrary fails to even load it:Fix:
xs:import→xs:includefor this one line (xs:includetakes nonamespaceattribute).Closes #7
Test plan
xmlschemalibrary after the change (previously failed to even load the schema)