-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import
ignored, when importing second XSD into the same namespace
#419
Comments
Hi, I don't know how Altova manages multiple imports of the same namespace. The note that you cited include another part before:
So I've to check if permitting multiple imports of the same namespace will not produce problems on deciding which components consider to build the complete schema in case of name collisions. In these cases for import/redefine/override an error is raised, but for imports I've to check if this can be a problem. Consider that imported schemas are often edited by others. Anyway the recommendation is clear in the note so allowing multiple imports of the same namespace will be eventually supported by an option and disabled by default. Thank you |
Hi, thanks for the consideration. I think name collisions with multiple imports should be handled the same as name collision in includes, or, in the same schema. It is up to the schema authors to avoid them and to know what they are doing. |
Locations in The enhancement will be included in the next major release. Probably it will be handled with one or more loader classes. The default strategy will remain the current (process only the first import for each namespace), the others will be based on the absolute URL of schemas. I will include also a URL-based loader that reject imports that generate a collisions (producing only a warning). With a class-based loader the behavior can be changed by a developer/user using a derived class. |
I have this document and an XSD (linked from it from schemaLocation).
Now, the XSD imports 2 other XSDs with the same targetNamespace:
The XSDs have both the same targetNamespace and contain no conflicting definitions. Nevertheless, the second import is ignored, resulting in an error:
unknown type 'osoby:fyzická_osoba_ve_vztahu_k_dokumentu
because that type is defined in the second imported XSD. When I comment out the first import, the second starts working.
This should be legal in XML Schema, and other validators like Altova work fine with it.
To be fair, this behavior is not explicitly forbidden by the specification, see Note at the end of 4.2.6.2, but there is a warning that applications might miss information, if implemented like this, which is exactly the case here.
The text was updated successfully, but these errors were encountered: