Skip to content

Commit e9d863a

Browse files
committed
fix previous commit for xml
1 parent a70c46c commit e9d863a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

owslib/feature/postrequest.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,10 @@ def set_filter(self, filter):
175175
"""
176176
if isinstance(filter, str):
177177
f = etree.fromstring(filter)
178-
# If this raises an error, it means the filter string does not contain an actual Filter node.
179-
sub_elem = f.xpath("//FES:Filter", namespaces={"FES": FES_NAMESPACE})[0]
178+
if f.tag == util.nspath("Filter", FES_NAMESPACE):
179+
sub_elem = f
180+
else:
181+
sub_elem = f.find(util.nspath("Filter", FES_NAMESPACE))
180182

181183
else:
182184
sub_elem = filter

0 commit comments

Comments
 (0)