<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-forward-container">H<font size="-1"><font
          face="Helvetica, Arial, sans-serif">i,<br>
          <br>
          I have created a SOS server based on 52ÂșN, and I'm testing
          using OWSLib.<br>
          There's no problem with SOS 2.0 ('<a
            class="moz-txt-link-freetext"
            href="http://www.opengis.net/om/2.0" moz-do-not-send="true">http://www.opengis.net/om/2.0</a>'),
          but when I make requests with WaterML only get errors.<br>
          In [</font></font><font size="-1"><font face="Helvetica,
          Arial, sans-serif"><font size="-1"><font face="Helvetica,
              Arial, sans-serif"><a class="moz-txt-link-freetext"
                href="https://dpaste.de/soEn" moz-do-not-send="true">https://dpaste.de/soEn</a>]</font></font>
          is everything: program, XML example (response from my server)
          and error output.<br>
          <br>
          Thanks in advance.<br>
          <br>
          Javier.<br>
          <br>
          <br>
          RAW:<br>
          <br>
        </font></font>
      <pre><b>Code:</b>
from owslib.sos import SensorObservationService
from owslib.swe.observation.sos200 import SOSGetObservationResponse
from owslib.etree import etree
file = open('ejemplo.xml')
xml_tree = etree.fromstring(file.read())
parsed_response = SOSGetObservationResponse(xml_tree)

<b>File 'ejemplo.xml":</b>
<?xml version="1.0" encoding="UTF-8"?>
<sos:GetObservationResponse xmlns:sos=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/sos/2.0" moz-do-not-send="true">"http://www.opengis.net/sos/2.0"</a> xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance" moz-do-not-send="true">"http://www.w3.org/2001/XMLSchema-instance"</a> xmlns:om=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/om/2.0" moz-do-not-send="true">"http://www.opengis.net/om/2.0"</a> xmlns:gml=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/gml/3.2" moz-do-not-send="true">"http://www.opengis.net/gml/3.2"</a> xmlns:xlink=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xlink" moz-do-not-send="true">"http://www.w3.org/1999/xlink"</a> xmlns:wml2=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/waterml/2.0" moz-do-not-send="true">"http://www.opengis.net/waterml/2.0"</a> xsi:schemaLocation=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/waterml/2.0http://schemas.opengis.net/waterml/2.0/waterml2.xsdhttp://www.opengis.net/sos/2.0http://schemas.opengis.net/sos/2.0/sosGetObservation.xsdhttp://www.opengis.net/waterml-dr/2.0http://schemas.opengis.net/waterml/2.0/domain-range-informative/timeseries-domain-range.xsdhttp://www.opengis.net/gml/3.2http://schemas.opengis.net/gml/3.2.1/gml.xsdhttp://www.opengis.net/gmlcov/1.0http://schemas.opengis.net/gmlcov/1.0/gmlcovAll.xsdhttp://www.opengis.net/om/2.0http://schemas.opengis.net/om/2.0/observation.xsd" moz-do-not-send="true">"http://www.opengis.net/waterml/2.0 http://schemas.opengis.net/waterml/2.0/waterml2.xsd http://www.opengis.net/sos/2.0 http://schemas.opengis.net/sos/2.0/sosGetObservation.xsd http://www.opengis.net/waterml-dr/2.0 http://schemas.opengis.net/waterml/2.0/domain-range-informative/timeseries-domain-range.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/gmlcov/1.0 http://schemas.opengis.net/gmlcov/1.0/gmlcovAll.xsd http://www.opengis.net/om/2.0 http://schemas.opengis.net/om/2.0/observation.xsd"</a>>
  <sos:observationData>
    <om:OM_Observation gml:id="o_A8A2A8E923A0C1038316522BE3A1A203BD87335F">
      <om:type xlink:href=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/def/observationType/waterml/2.0/MeasurementTimeseriesTVPObservation" moz-do-not-send="true">"http://www.opengis.net/def/observationType/waterml/2.0/MeasurementTimeseriesTVPObservation"</a>/>
      <om:phenomenonTime>
        <gml:TimeInstant gml:id="phenomenonTime_1">
          <gml:timePosition>2011-12-30T22:00:00.000Z</gml:timePosition>
        </gml:TimeInstant>
      </om:phenomenonTime>
      <om:resultTime xlink:href="#phenomenonTime_1"/>
      <om:procedure xlink:href="discharge"/>
      <om:observedProperty xlink:href="Caudal_de_agua"/>
      <om:featureOfInterest xlink:href="156" xlink:title="Achleiten / Donau"/>
      <om:result>
        <wml2:MeasurementTimeseries gml:id="timeseries.1">
          <wml2:metadata>
            <wml2:TimeseriesMetadata>
              <wml2:temporalExtent xlink:href="#phenomenonTime_1"/>
            </wml2:TimeseriesMetadata>
          </wml2:metadata>
          <wml2:defaultPointMetadata>
            <wml2:DefaultTVPMeasurementMetadata>
              <wml2:uom code="m3/s"/>
              <wml2:interpolationType xlink:href=<a class="moz-txt-link-rfc2396E" href="http://www.opengis.net/def/timeseriesType/WaterML/2.0/continuous" moz-do-not-send="true">"http://www.opengis.net/def/timeseriesType/WaterML/2.0/continuous"</a> xlink:title="Instantaneous"/>
            </wml2:DefaultTVPMeasurementMetadata>
          </wml2:defaultPointMetadata>
          <wml2:point>
            <wml2:MeasurementTVP>
              <wml2:time>2011-12-30T22:00:00.000Z</wml2:time>
              <wml2:value>5.0</wml2:value>
            </wml2:MeasurementTVP>
          </wml2:point>
        </wml2:MeasurementTimeseries>
      </om:result>
    </om:OM_Observation>
  </sos:observationData>
</sos:GetObservationResponse>  

<b>Output:</b>
Traceback (most recent call last):
  File "E:\ESS\SOS\OWSLib\prueba2.py", line 6, in <module>
    parsed_response = SOSGetObservationResponse(xml_tree)
  File "E:\programas\python27\lib\site-packages\owslib\swe\observation\sos200.py", line 351, in __init__
    parsed_obs = decoder.decode_observation(obs)
  File "E:\programas\python27\lib\site-packages\owslib\swe\observation\sos200.py", line 385, in decode_observation
    return MeasurementTimeseriesObservation(element)
  File "E:\programas\python27\lib\site-packages\owslib\swe\observation\waterml2.py", line 34, in __init__
    self._parse_result()
  File "E:\programas\python27\lib\site-packages\owslib\swe\observation\waterml2.py", line 41, in _parse_result
    self.result = MeasurementTimeseries(result)
  File "E:\programas\python27\lib\site-packages\owslib\swe\observation\waterml2.py", line 58, in __init__
    self.defaultTVPMetadata = TVPMeasurementMetadata(element.find(
AttributeError: 'NoneType' object has no attribute 'find'</pre>
    </div>
  </body>
</html>