wmo-im / iwxxm

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

Multiple CB cloud locations in TCA fails validation #158

Closed mgoberfield closed 5 years ago

mgoberfield commented 5 years ago

Bug with TropicalCycloneAdvisory.TropicalCycloneObservedConditions-6 rule: multiple elements cause validation to fail.

blchoy commented 5 years ago

@mgoberfield : Found the issue. Please see if this works (basically I added "empty(index-of(..., false()))"). If so I will apply this to all rules involving CRS:

   <sch:pattern id="TropicalCycloneAdvisory.TropicalCycloneObservedConditions-6">
      <sch:rule context="//iwxxm:TropicalCycloneObservedConditions">
         <sch:assert test="( if( exists(iwxxm:cumulonimbusCloudLocation//*[self::aixm:horizontalProjection or self::aixm:centreline]) ) then( empty(index-of(iwxxm:cumulonimbusCloudLocation//*[self::aixm:Surface or self::aixm:Curve]/(ancestor-or-self::*[exists(@srsName)])[last()]/(@srsDimension='2' and exists(@axisLabels)), false())) ) else( true() ) )">TropicalCycloneAdvisory.TropicalCycloneObservedConditions-6: If a geometry of iwxxm:cumulonimbusCloudLocation is defined with the provision of attribute srsName, attribute srsDimension must equal to 2 and attribute axisLabels must be non-empty</sch:assert>
      </sch:rule>
   </sch:pattern>

@marqh : Shall we release a RC4? However, @efucile has yet to publish it on schemas.wmo.int so it has not been officially released.

mgoberfield commented 5 years ago

I may be able to check your solution this weekend, @blchoy . If so, I will follow-up with a message before Monday morning. I will be out of the office next week.

Being very appreciative of everyone's efforts, we need to find these kinds of issues before releases. To that end, how can I help with that? I was thinking along the lines of automated tests, harnessing Travis/CI.

Do we need more AIRMETs and SIGMETs cases? I can dredge up some additional examples but it will not be soon.

blchoy commented 5 years ago

@mgoberfield : I have created two PRs for your review. Please merge if you find it OK and I will figure out the rest when I am in Montreal Sunday evening.

mgoberfield commented 5 years ago

Closed