iris-edu / stationxml-validator

GNU General Public License v3.0
16 stars 8 forks source link

Validator should generate error if <site><Name> is empty #150

Closed Stephen-Veitch closed 2 months ago

Stephen-Veitch commented 1 year ago

Currently the validator will pass a stationxml where a station (site) lacks a name ie:

<Station code="SNET" startDate="1997-08-29T:02:14:00.000Z" endDate="2016-02-20T08:15:00.000Z">
      <Latitude unit="DEGREES">34.05102</Latitude>
      <Longitude unit="DEGREES">-118.25321</Longitude>
      <Elevation unit="METERS">102.0</Elevation>
      <Site>
            <Name></Name>
      </Site>
...

But the DMC's ingestion software seems not to like this, and currently it doesn't even generate a warning!

timronan commented 1 year ago

The loader does not accept the Site.Name field to be null. It does accept:

""

Site.Name is required by the stationxml xsd schema. The schema does not check if the field is null. This null check could potentially be added to the stationxml-validator, but is seems like this check should potentially be enforced by the schema.