diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d6e36b0..c8dc679 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +[v0.14.1] - 2024-03-15 +--------------------- + +Fixed +~~~~~ + +* wrong xpath for operation urls + [v0.14.0] - 2024-02-21 --------------------- diff --git a/ows_lib/__init__.py b/ows_lib/__init__.py index 061acee..c21c771 100644 --- a/ows_lib/__init__.py +++ b/ows_lib/__init__.py @@ -1,2 +1,2 @@ -__version__ = "0.14.0" +__version__ = "0.14.1" VERSION = __version__ # synonym diff --git a/ows_lib/xml_mapper/capabilities/wms/wms111.py b/ows_lib/xml_mapper/capabilities/wms/wms111.py index aba8f80..8c41c82 100644 --- a/ows_lib/xml_mapper/capabilities/wms/wms111.py +++ b/ows_lib/xml_mapper/capabilities/wms/wms111.py @@ -68,7 +68,7 @@ class LegendUrl(WebMapServiceDefaultSettings): ROOT_NAME = "LegendUrl" legend_url = StringField( - xpath="./OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./OnlineResource/@xlink:href") height = IntegerField(xpath="./@height") width = IntegerField(xpath="./@width") mime_type = NodeField(xpath="./Format", node_class=MimeType) @@ -83,7 +83,7 @@ class Style(WebMapServiceDefaultSettings): class RemoteMetadata(WebMapServiceDefaultSettings): - ROOT_NAME = "OnlineResource[@xlink:type='simple']/@xlink:href" + ROOT_NAME = "OnlineResource/@xlink:href" link = StringField( xpath="./@xlink:href") @@ -124,7 +124,7 @@ class Layer(LayerMixin, WebMapServiceDefaultSettings): children = NodeListField(xpath="./Layer", node_class="self") remote_metadata = NodeListField( - xpath="./MetadataURL/OnlineResource[@xlink:type='simple']", + xpath="./MetadataURL/OnlineResource", node_class=RemoteMetadata) @@ -145,7 +145,7 @@ class WebMapService(WebMapServiceMixin, WebMapServiceDefaultSettings): keywords = StringListField(xpath="./Service/KeywordList/Keyword") service_url = StringField( - xpath="./Service/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Service/OnlineResource/@xlink:href") service_type = NodeField(xpath=".", node_class=ServiceType) @@ -161,41 +161,41 @@ class WebMapService(WebMapServiceMixin, WebMapServiceDefaultSettings): _get_capabilities_mime_types = StringListField( xpath="./Capability/Request/GetCapabilities/Format") _get_capabilities_get_url = StringField( - xpath="./Capability/Request/GetCapabilities/DCPType/HTTP/Get/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetCapabilities/DCPType/HTTP/Get/OnlineResource/@xlink:href") _get_capabilities_post_url = StringField( - xpath="./Capability/Request/GetCapabilities/DCPType/HTTP/Post/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetCapabilities/DCPType/HTTP/Post/OnlineResource/@xlink:href") _get_map_mime_types = StringListField( xpath="./Capability/Request/GetMap/Format") _get_map_get_url = StringField( - xpath="./Capability/Request/GetMap/DCPType/HTTP/Get/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetMap/DCPType/HTTP/Get/OnlineResource/@xlink:href") _get_map_post_url = StringField( - xpath="./Capability/Request/GetMap/DCPType/HTTP/Post/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetMap/DCPType/HTTP/Post/OnlineResource/@xlink:href") _get_feature_info_mime_types = StringListField( xpath="./Capability/Request/GetFeatureInfo/Format") _get_feature_info_get_url = StringField( - xpath="./Capability/Request/GetFeatureInfo/DCPType/HTTP/Get/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetFeatureInfo/DCPType/HTTP/Get/OnlineResource/@xlink:href") _get_feature_info_post_url = StringField( - xpath="./Capability/Request/GetFeatureInfo/DCPType/HTTP/Post/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetFeatureInfo/DCPType/HTTP/Post/OnlineResource/@xlink:href") _describe_layer_mime_types = StringListField( xpath="./Capability/Request/DescribeLayer/Format") _describe_layer_get_url = StringField( - xpath="./Capability/Request/DescribeLayer/DCPType/HTTP/Get/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/DescribeLayer/DCPType/HTTP/Get/OnlineResource/@xlink:href") _describe_layer_post_url = StringField( - xpath="./Capability/Request/DescribeLayer/DCPType/HTTP/Post/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/DescribeLayer/DCPType/HTTP/Post/OnlineResource/@xlink:href") _get_legend_graphic_mime_types = StringListField( xpath="./Capability/Request/GetLegendGraphic/Format") _get_legend_graphic_get_url = StringField( - xpath="./Capability/Request/GetLegendGraphic/DCPType/HTTP/Get/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetLegendGraphic/DCPType/HTTP/Get/OnlineResource/@xlink:href") _get_legend_graphic_post_url = StringField( - xpath="./Capability/Request/GetLegendGraphic/DCPType/HTTP/Post/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetLegendGraphic/DCPType/HTTP/Post/OnlineResource/@xlink:href") _get_styles_mime_types = StringListField( xpath="./Capability/Request/GetStyles/Format") _get_styles_get_url = StringField( - xpath="./Capability/Request/GetStyles/DCPType/HTTP/Get/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetStyles/DCPType/HTTP/Get/OnlineResource/@xlink:href") _get_styles_post_url = StringField( - xpath="./Capability/Request/GetStyles/DCPType/HTTP/Post/OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./Capability/Request/GetStyles/DCPType/HTTP/Post/OnlineResource/@xlink:href") diff --git a/ows_lib/xml_mapper/capabilities/wms/wms130.py b/ows_lib/xml_mapper/capabilities/wms/wms130.py index 051e433..7dfeb82 100644 --- a/ows_lib/xml_mapper/capabilities/wms/wms130.py +++ b/ows_lib/xml_mapper/capabilities/wms/wms130.py @@ -69,7 +69,7 @@ class LegendUrl(WebMapServiceDefaultSettings): ROOT_NAME = "LegendUrl" legend_url = StringField( - xpath="./wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:OnlineResource/@xlink:href") height = IntegerField(xpath="./@height") width = IntegerField(xpath="./@width") mime_type = NodeField(xpath="./wms:Format", node_class=MimeType) @@ -84,7 +84,7 @@ class Style(WebMapServiceDefaultSettings): class RemoteMetadata(WebMapServiceDefaultSettings): - ROOT_NAME = "OnlineResource[@xlink:type='simple']/@xlink:href" + ROOT_NAME = "OnlineResource/@xlink:href" link = StringField( xpath="./@xlink:href") @@ -123,7 +123,7 @@ class Layer(LayerMixin, WebMapServiceDefaultSettings): children = NodeListField(xpath="./wms:Layer", node_class="self") remote_metadata = NodeListField( - xpath="./wms:MetadataURL/wms:OnlineResource[@xlink:type='simple']", + xpath="./wms:MetadataURL/wms:OnlineResource", node_class=RemoteMetadata) @@ -137,7 +137,7 @@ class WebMapService(WebMapServiceMixin, WebMapServiceDefaultSettings): access_constraints = StringField( xpath="./wms:Service/wms:AccessConstraints") service_url = StringField( - xpath="./wms:Service/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Service/wms:OnlineResource/@xlink:href") # ForeignKey service_contact = NodeField(xpath="./wms:Service/wms:ContactInformation", @@ -161,41 +161,41 @@ class WebMapService(WebMapServiceMixin, WebMapServiceDefaultSettings): _get_capabilities_mime_types = StringListField( xpath="./wms:Capability/wms:Request/wms:GetCapabilities/wms:Format") _get_capabilities_get_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetCapabilities/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetCapabilities/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource/@xlink:href") _get_capabilities_post_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetCapabilities/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetCapabilities/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource/@xlink:href") _get_map_mime_types = StringListField( xpath="./wms:Capability/wms:Request/wms:GetMap/wms:Format") _get_map_get_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetMap/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetMap/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource/@xlink:href") _get_map_post_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetMap/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetMap/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource/@xlink:href") _get_feature_info_mime_types = StringListField( xpath="./wms:Capability/wms:Request/wms:GetFeatureInfo/wms:Format") _get_feature_info_get_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetFeatureInfo/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetFeatureInfo/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource/@xlink:href") _get_feature_info_post_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetFeatureInfo/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetFeatureInfo/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource/@xlink:href") _describe_layer_mime_types = StringListField( xpath="./wms:Capability/wms:Request/wms:DescribeLayer/wms:Format") _describe_layer_get_url = StringField( - xpath="./wms:Capability/wms:Request/wms:DescribeLayer/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:DescribeLayer/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource/@xlink:href") _describe_layer_post_url = StringField( - xpath="./wms:Capability/wms:Request/wms:DescribeLayer/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:DescribeLayer/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource/@xlink:href") _get_legend_graphic_mime_types = StringListField( xpath="./wms:Capability/wms:Request/wms:GetLegendGraphic/wms:Format") _get_legend_graphic_get_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetLegendGraphic/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetLegendGraphic/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource/@xlink:href") _get_legend_graphic_post_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetLegendGraphic/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetLegendGraphic/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource/@xlink:href") _get_styles_mime_types = StringListField( xpath="./wms:Capability/wms:Request/wms:GetStyles/wms:Format") _get_styles_get_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetStyles/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetStyles/wms:DCPType/wms:HTTP/wms:Get/wms:OnlineResource/@xlink:href") _get_styles_post_url = StringField( - xpath="./wms:Capability/wms:Request/wms:GetStyles/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource[@xlink:type='simple']/@xlink:href") + xpath="./wms:Capability/wms:Request/wms:GetStyles/wms:DCPType/wms:HTTP/wms:Post/wms:OnlineResource/@xlink:href")