<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<br><br><div><div id="SkyDrivePlaceholder"></div>> Date: Sun, 25 Mar 2012 12:21:24 -0700<br>> From: nick.gart@gmail.com<br>> To: owslib-users@lists.sourceforge.net<br>> Subject: [owslib-users] parsing xml capabilities file<br>> <br>> I am trying to create a WebMapService from this url:<br>> http://imselev.cr.usgs.gov/WMS_Capabilities/USGS_EDC_Elev_NED_3/capabilities_1_3_0.xml<br>> <br>> but it doesn't seem to be parsing correctly:<br>> <br>> <br>>   File "<stdin>", line 1, in <module><br>>   File "/Library/Python/2.5/site-packages/OWSLib-0.4.0-py2.5.egg/owslib/wms.py",<br>> line 86, in __init__<br>>     self._buildMetadata(parse_remote_metadata)<br>>   File "/Library/Python/2.5/site-packages/OWSLib-0.4.0-py2.5.egg/owslib/wms.py",<br>> line 101, in _buildMetadata<br>>     self.identification=ServiceIdentification(serviceelem, self.version)<br>>   File "/Library/Python/2.5/site-packages/OWSLib-0.4.0-py2.5.egg/owslib/wms.py",<br>> line 267, in __init__<br>>     self.type = testXMLValue(self._root.find('Name'))<br>> AttributeError: 'NoneType' object has no attribute 'find'<br>> <br>> <br>> Since the URl isn't a CGI link, I tried pulling the XML and feeding<br>> that in as XML too:<br>> <br>> <br>> >>> capurl = urllib2.urlopen('http://imselev.cr.usgs.gov/WMS_Capabilities/USGS_EDC_Elev_NED_3/capabilities_1_3_0.xml').readlines()<br>> >>>capstring = "".join(capurl)<br>> >>> wms = WebMapService('',xml=capstring)<br>> Traceback (most recent call last):<br>>   File "<stdin>", line 1, in <module><br>>   File "/Library/Python/2.5/site-packages/OWSLib-0.4.0-py2.5.egg/owslib/wms.py",<br>> line 86, in __init__<br>>     self._buildMetadata(parse_remote_metadata)<br>>   File "/Library/Python/2.5/site-packages/OWSLib-0.4.0-py2.5.egg/owslib/wms.py",<br>> line 101, in _buildMetadata<br>>     self.identification=ServiceIdentification(serviceelem, self.version)<br>>   File "/Library/Python/2.5/site-packages/OWSLib-0.4.0-py2.5.egg/owslib/wms.py",<br>> line 267, in __init__<br>>     self.type = testXMLValue(self._root.find('Name'))<br>> AttributeError: 'NoneType' object has no attribute 'find'<br>> <br>> <br>> Am I going about this properly?<br><br>Nick: owslib doesn't support WMS 1.3.0 as of yet.  If you would like to see support, please file a ticket in https://sourceforge.net/apps/trac/owslib.  Not sure how much work this would be, given the differences between 1.1.1 and 1.3.0.<br><br>Cheers<br><br>..Tom<br><br></div>                                      </div></body>
</html>