wmo-im / iwxxm

XML schema and Schematron for aviation weather data exchange
https://old.wmo.int/wiswiki/tiki-index.php%3Fpage=TT-AvXML
49 stars 22 forks source link

Consider alignment of the ways XML entities are made empty with @nilReason support #19

Closed marqh closed 6 years ago

marqh commented 7 years ago

It was noticed that UML Classes with stereotypes <<dataType>> transform into XML schemas with no empty content and @nilReason support (see Section E2.4.5 of ISO 19136:2007 for details). For the rest of the stereotypes since the corresponding XML schema serialization are extending GML types which include directly or indirectly attributeGroup "AssociationAttributeGroup" (support for using xlink), the resulting XML entities will automatically allow empty content and the use of @nilReason. To include support for empty content and @nilReason to <<dataType>> UML Class and others which have similar super classes like GML primitives, GML introduces relevant UML-to-XML schema serialization rule with the use of tagged value nillable="true" in UML attributes and UML association ends (see Section 8.2.3.2 of ISO 19136:2007). The latter arrangement, however, requires the use of xsi:nil="true" in an instance to signify that the entity is empty. The following indicates differences of the approaches:

With "AssociationAttributeGroup": <iwxxm:forecastWeather nilReason="http://codes.wmo.int/common/nil/nothingOfOperationalSignificance"/>
In accordance to Section 8.2.3.2: <iwxxm:prevailingVisibility xsi:nil="true" uom="N/A" nilReason="missing"/>

As the above may introduce confusion to implementors, it is necessary to consider whether a technical or documentary solution will be used to overcome this issue.

ref: https://software.ecmwf.int/issues/browse/AVXML-54

Reporter:
    B L Choy 

Created:
    06/Apr/17 7:01 PM 
marqh commented 7 years ago

related to #16

braeckel commented 7 years ago

The xsi:nil is required in cases where the XML Schema defines contents, such as the prevailingVisibility case above using MeasureType. The reference types do not require contents and therefore do not require any "nilling". The most we can do is look for cases where we unnecessarily create elements with content intended to be nillable or in cases where GML provides an alternative that does not require it to be nilled.

braeckel commented 6 years ago

If we ever decide to go with an alternative representation for measured types we can revisit this, but for the time being this is the recommended option for nillable GML MeasureTypes.

An example of a nilled MeasureType should be added to the TAC to XML Guidance document, after which this issue can be closed.