Thread: empty InstrumentSensitivity causes invalid xml

Started: 2015-07-13 22:43:56
Last activity: 2015-07-13 22:43:56
Philip Crotwell
2015-07-13 22:43:56
Hi

For quite a few channels, for example:
http://service.iris.edu/fdsnws/station/1/query?level=channel&network=II&starttime=2007-04-04T00:00:01.000&station=ABPO&channel=LOG

the fdsn station ws returns something like:
...
<Sensor>
<Type>Console Log - Error Log</Type>
</Sensor>
<Response>
<InstrumentSensitivity></InstrumentSensitivity>
</Response>
</Channel>

My guess is that you have no response information at all in the dataless
since this is a LOG channel. But in the schema, InstrumentSensitivity is
required to have Value, Frequency, InputUnits and OutputUnits. On the other
hand, Response is not required to have InstrumentSensitivity, and Response
itself is not required. So in cases where you don't know anything, it might
be better to omit the InstrumentSensitivity entirely instead of putting it
in as an empty element. THis would make the resulting XML valid and not
really change the meaning I think. In other words, return this...

<Sensor>
<Type>Console Log - Error Log</Type>
</Sensor>
<Response>
</Response>
</Channel>

or even this:


<Sensor>
<Type>Console Log - Error Log</Type>
</Sensor>
</Channel>

thanks,
Philip

  • Chad Trabant
    2015-07-13 20:15:04

    Hi Philip,

    I agree, your suggested 2nd output seems better to me. Let me discuss this internally with folks to make sure that wouldn't be a problem.

    Chad

    On Jul 13, 2015, at 12:44 PM, Philip Crotwell <crotwell<at>seis.sc.edu> wrote:


    Hi

    For quite a few channels, for example:
    http://service.iris.edu/fdsnws/station/1/query?level=channel&network=II&starttime=2007-04-04T00:00:01.000&station=ABPO&channel=LOG

    the fdsn station ws returns something like:
    ...
    <Sensor>
    <Type>Console Log - Error Log</Type>
    </Sensor>
    <Response>
    <InstrumentSensitivity></InstrumentSensitivity>
    </Response>
    </Channel>

    My guess is that you have no response information at all in the dataless since this is a LOG channel. But in the schema, InstrumentSensitivity is required to have Value, Frequency, InputUnits and OutputUnits. On the other hand, Response is not required to have InstrumentSensitivity, and Response itself is not required. So in cases where you don't know anything, it might be better to omit the InstrumentSensitivity entirely instead of putting it in as an empty element. THis would make the resulting XML valid and not really change the meaning I think. In other words, return this...

    <Sensor>
    <Type>Console Log - Error Log</Type>
    </Sensor>
    <Response>
    </Response>
    </Channel>

    or even this:


    <Sensor>
    <Type>Console Log - Error Log</Type>
    </Sensor>
    </Channel>

    thanks,
    Philip

    ----------------------
    DMC Web Service Developer (http://ds.iris.edu/message-center/topic/dmc-web-service-developer/)

    Sent via IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/


    • Chad Trabant
      2015-07-13 20:45:00

      After a quick discussion here we are going to do your first suggestion of leaving an empty <Response> element when there is no response. More specifically we will not include the <InstrumentSensitivity> when there is nothing to put in it.

      While the later suggestion of removing <Response> entirely seems clean, it's harder (due to the streaming creation of the XML) and therefore more error prone. At least with the change we'll make these will be valid.

      Thanks for the suggestion. Change will likely be in the release after next.

      Chad

      Hi Philip,

      I agree, your suggested 2nd output seems better to me. Let me discuss this internally with folks to make sure that wouldn't be a problem.

      Chad

      On Jul 13, 2015, at 12:44 PM, Philip Crotwell <crotwell<at>seis.sc.edu <crotwell<at>seis.sc.edu>> wrote:


      Hi

      For quite a few channels, for example:
      http://service.iris.edu/fdsnws/station/1/query?level=channel&network=II&starttime=2007-04-04T00:00:01.000&station=ABPO&channel=LOG

      the fdsn station ws returns something like:
      ...
      <Sensor>
      <Type>Console Log - Error Log</Type>
      </Sensor>
      <Response>
      <InstrumentSensitivity></InstrumentSensitivity>
      </Response>
      </Channel>

      My guess is that you have no response information at all in the dataless since this is a LOG channel. But in the schema, InstrumentSensitivity is required to have Value, Frequency, InputUnits and OutputUnits. On the other hand, Response is not required to have InstrumentSensitivity, and Response itself is not required. So in cases where you don't know anything, it might be better to omit the InstrumentSensitivity entirely instead of putting it in as an empty element. THis would make the resulting XML valid and not really change the meaning I think. In other words, return this...

      <Sensor>
      <Type>Console Log - Error Log</Type>
      </Sensor>
      <Response>
      </Response>
      </Channel>

      or even this:


      <Sensor>
      <Type>Console Log - Error Log</Type>
      </Sensor>
      </Channel>

      thanks,
      Philip

      ----------------------
      DMC Web Service Developer (http://ds.iris.edu/message-center/topic/dmc-web-service-developer/)

      Sent via IRIS Message Center (http://ds.iris.edu/message-center/)
      Update subscription preferences at http://ds.iris.edu/account/profile/



Page built 16:49:10 | v.34dba33a