Skip to content
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

Elements of NilReasonType must have nillable attribute set #14

Open
mgoberfield opened this issue Nov 17, 2020 · 4 comments
Open

Elements of NilReasonType must have nillable attribute set #14

mgoberfield opened this issue Nov 17, 2020 · 4 comments
Assignees

Comments

@mgoberfield
Copy link
Contributor

The following schema/elements do not have the nillable attributes set. WIthout them, the elements cannot be made, well, nillable.

  • airmet/sequenceNumber
  • sigmet/sequenceNumber
  • spaceWxAdvisory/advisoryNumber
  • spaceWxAdvisory/remarks
  • tropicalCycloneAdvisory/advisoryNumber
  • tropicalCycloneAdvisory/remarks
  • volcanicAshAdvisory/stateOrRegion
  • volcanicAshAdvisory/summitElevation
  • volcanicAshAdvisory/advisoryNumber
  • volcanicAshAdvisory/informationSource
  • volcanicAshAdvisory/remarks
@mgoberfield
Copy link
Contributor Author

mgoberfield commented Nov 17, 2020

The majority of the elements listed above are of StringWithNilReason type which the absence of a string is valid. This means the nillable attribute (i.e., 'xsi:nil') is optional for StringWithNilReason elements and not explicitly required in order to be valid. But this behavior is inconsistent with the other 'WithNilReason' types as they do require 'xsi:nil=true' to be set in order to be valid. The volcanicAshAdvisory/summitElevation element type is LengthWithNilReason. In the cases of summitElevation being set to 'SFC' or 'UNKNOWN', using the nilReason attribute alone is not sufficient, and resulting XML not valid: the nillable attribute is not provided. The pull-request associated with this issue, 17053f5, fixes that and makes the StringWithNilReason elements consistent with the other 'WithNilReason' elements.

@mgoberfield
Copy link
Contributor Author

mgoberfield commented Dec 1, 2020

To be overbearingly pedantic and oh so tedious, I provide an example that illustrates the inconsistency.
A simple schema using the IWXXM 'WithNilReason' types

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:iwxxm="http://icao.int/iwxxm/3.0" xmlns:mgo="test"
    elementFormDefault="qualified" targetNamespace="test">
    <import namespace="http://icao.int/iwxxm/3.0" schemaLocation="http://schemas.wmo.int/iwxxm/3.0/iwxxm.xsd"/>
    <element name="TestObject" type="mgo:TestTypes"/>
    <complexType name="TestTypes">
        <sequence>
            <element name="angle1" type="iwxxm:AngleWithNilReasonType"/>
            <element name="angle2" type="iwxxm:AngleWithNilReasonType" nillable="true"/>
            <element name="distance1" type="iwxxm:DistanceWithNilReasonType"/>
            <element name="distance2" type="iwxxm:DistanceWithNilReasonType" nillable="true"/>
            <element name="length1" type="iwxxm:LengthWithNilReasonType"/>
            <element name="length2" type="iwxxm:LengthWithNilReasonType" nillable="true"/>
            <element name="measure1" type="iwxxm:MeasureWithNilReasonType"/>
            <element name="measure2" type="iwxxm:MeasureWithNilReasonType" nillable="true"/>
            <element name="velocity1" type="iwxxm:VelocityWithNilReasonType"/>
            <element name="velocity2" type="iwxxm:VelocityWithNilReasonType" nillable="true"/>
            <element name="string1" type="iwxxm:StringWithNilReasonType"/>
            <element name="string2" type="iwxxm:StringWithNilReasonType" nillable="true"/>
        </sequence>
    </complexType>
</schema>

The resulting XML document using 'TestObject'
image

Notice that string1 element doesn't require the presence of the nill attribute in order to be valid, but is inconsistent with the other 'WithNilReasonType' elements.

@blchoy
Copy link
Member

blchoy commented Jan 10, 2021

Thank you. I have added nillable="true" to all the above mentioned in IWXXM 3.1 except iwxxm:summitElevation, as the actual element containing LengthWithNilReason has changed to iwxxm:summitElevation/iwxxm:Summit/iwxxm:elevation (see wmo-im/iwxxm#219 (comment)).

@mgoberfield
Copy link
Contributor Author

mgoberfield commented Aug 30, 2021

On review of the schemas, the following elements in bold do not have the attribute 'nillable' set to "true".

metarSpeci.xsd: if trend forecast does not specify a time period, iwxxm:phenomenonTime is nilled with unknown or missing

sigmet.xsd: if iwxxm:VolcanicAshSIGMETPositionCollection is nilled with nothingOfOperationalSignificance

spaceWeatherAdvisory.xsd: if iwxxm:locationIndicator is nilled with inapplicable
spaceWeatherAdvisory.xsd: if iwwxm:region is nilled with missing or nothingOfOperationalSignificance
spaceWeatherAdvisory.xsd: if last advisory, iwxxm:nextAdvisoryTime is nilled with inapplicable

taf.xsd: if no significant cloud (NSC) is forecast, iwxxm:cloud is nilled with nothingOfOperationalSignificance
taf.xsd: if no significant weather (NSW) is forecast, iwxxm:weather is nilled with nothingOfOperationalSignificance
taf.xsd: if TAF is NIL, iwxxm:baseForecast is nilled with missing

tropicalCycloneAdvisory.xsd: if last advisory, iwxxm:nextAdvisoryTime is nilled with inapplicable

volcanicAshAdvisory.xsd: if last advisory, iwxxm:nextAdvisoryTime is nilled with inapplicable

@mgoberfield mgoberfield reopened this Aug 30, 2021
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

No branches or pull requests

2 participants