Opened 13 years ago
Closed 13 years ago
#613 closed defect (fixed)
SchemaManager autodetect defaults to defaultSchema (with patch)
Reported by: | jesseeichar | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | v2.7.0 |
Component: | General | Version: | v2.6.3 |
Keywords: | Cc: |
Description
This is a problem in some situations like MEF import because if there 2 metadata files. In my case GM03 and iso19139.che. It does not recognize GM03 so it uses the default, then an error occurs when it tries to import GM03.
I have a patch that adds a second parameter that is the default to use. In all cases the current behaviour is used but MEF import has been changed so that null is returned if the schema is not auto detected so it is correctly handled.
Attachments (1)
Change History (5)
by , 13 years ago
Attachment: | 613_schema_defaults.diff added |
---|
comment:1 by , 13 years ago
Summary: | SchemaManager autodetect defaults to defaultSchema → SchemaManager autodetect defaults to defaultSchema (with patch) |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Our preferred schema is == to the defaultSchema. and if a file (in my case GM03) does not have a schema it returns the defaultSchema. And therefore the system thinks the file is the preferred metadata which is simply wrong. It should return null. And probably did in a previous version. But no longer does. My change makes this usecase work again.
comment:4 by , 13 years ago
Milestone: | v2.6.5 → v2.7.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
It would be better to always return null probably ? If schema detection failed it could be risky to import an XML with a non matching schema (that was made long time ago when autodetection was not so flexible). At least, we could log to warning in that case.
Committed revision 8237 (trunk).
Not sure if this related Jesse, but in config.xml you have
which in your case should be probably set to
This is used by MEF import to select which XML to load (See Importer#handleMetadataFiles).