-
Notifications
You must be signed in to change notification settings - Fork 22
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
Refactored version of IWXXM 2021-2RC2 #273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. I think the package XSDs need to include the measure schema too. For example, in Oxygen, airmet.xsd states: "Cannot resolve the name 'iwxxm:AngleWithNilReasonType' to a(n) 'type definition' component." These messages go away when I include the measure schema, for example, . (update: this is not problem, I was validating individal XSDs instead of starting from iwxxm.xsd)
-
Update schema location in iwxxm-collect, it is currently: http://schemas.wmo.int/iwxxm/2021-2RC2/iwxxm.xsd
-
iwxxm-collect -- can we remove or change the reference to http://def.wmo.int/collect/2014? It doesn't break anything, but this URL is no longer maintained...
"" -
We also might need to change the target schema URLs in all XSDs to be more generic (see email).
Thank you for bringing up the issue for re-using packages by different versions of IWXXM. You mentioned that:
The two airmet.xsd are different only in the namespace definition, the rest of them are the same.
Views please? |
are we discovering that IWXXM it's just a name and we have a number of different packages sharing a framework? |
Can we try what is happening if targetNamespace does not have any version targetNamespace="http://icao.int/iwxxm"? |
The original intend is to make sure we know if the format of say AIRMET is different across different versions of IWXXM. Take our previous case as an example. The following are IWXXM AIRMET instances under different versions of IWXXM:
If you look into the schemas, you will find:
So one can immediately tell from airmet.xsd in each IWXXM package that they are the same in every aspects (except the namespace). For version 3.0.0 or before, the version number in the airmet.xsd will be 2021-2 and 2030-1 respectively so there is no way to tell if the two schemas are the same. Therefore the new versioning scheme gives a machine readable identification on the schemas without the need to go to external lookup. It does not, however, provide the framework for reusable packages. To achieve the latter one will need to move one step further to make them independent from IWXXM. i.e. use different namespaces for the packages. But this is beyond a minor change to the design. I have to say that this is something I missed too when we discuss the establishment of the new schema directory structure. |
I confirmed that this is a workable arrangement. In fact, I have created a new branch with both schemas for 2021-2 and 3.0.0 in place and a test document with both versions of IWXXM in a single COLLECT. |
Committed changes involving a new targetNameSpace of http://icao.int/iwxxm. Looks good to me. |
May be I celebrated too early. Let me recap what has been done and its consequence. We changed the targetNamespace from http://icao.int/iwxxm/2021-2 to http://icao.int/iwxxm in order to make XSDs of packages like TAF to be reusable by different versions of IWXXM. Recalling that iwxxm.xsd is the top level schema which links up XSDs of all necessary packages: Fragment of iwxxm.xsd for version 2021-2RC2:
Now in an instance, selection/indication of the version of IWXXM making reference to will no longer be done through the namespace but the included schema:
And we are using the locality of the scope of a namespace to make it possible for COLLECT to carry 2 IWXXM instances in different versions at the same time:
It works, but I doubt it is a good practice. Now the problem comes with schematron. In an assertion, it needs to traverse the tags of an IWXXM instance with XPath and the namespace comes into play: Fragment of iwxxm.sch:
We may be able to apply the same trick to make the schematron rules for version 2021-2 to confine its scope to those part of the IWXXM instance having schemaLocation of http://schemas.wmo.int/iwxxm/2021-2/iwxxm.xsd without using namespace as identifier, but this will make the rules (1) complicated, (2) rely on a changeable physical location of iwxxm.xsd to identify the version of IWXXM the fragment of instance is based on, and (3) may not be sustainable in long run. I personally think that this has gone beyond the intended use of XML features. Furthermore treating assertions is not a day or two's work. Views? |
@blchoy @amilan17 |
Definitely. We may also want to take into account the updating of the code tables too, as we may have objects which are solely defined on contents of some tables. |
It looks like it will take a couple more days and some thoughts on refactoring. I agree with closing this PR, continuing the discussion for a future release and moving forward with FT2021-2RC2 branch for this release. |
I think it is not how simple/hard it is, it is whether it is right to proceed in this way which I think is beyond the normal use of XML features. We may want to go back to see if there is another, more appropriate route to go. I agree with Anna that we should close this PR now and prepare it for the next version. |
This is the refactored version of IWXXM 2021-2RC2 with new schema directory structure. I finally managed to make the validation scripts run correctly. Basically, the files under sub-directory IWXXM are those to be uploaded to schemas.wmo.int or downloaded for local implementation. The reason for taking such a long time to change the validation script is the unfortunate fact that we are using both upper and lower case letters in schema file names and sub-directories which, for some OSs like Linux are not to be ignored.
@amilan17 I think I have finished all my work here and I will leave it to you to consider merging this branch into the IWXXM 2021-2RC2 branch, or leave it alone until after the FT procedures. Either is fine with me.