Skip to content

Commit

Permalink
fix previous commit for xml
Browse files Browse the repository at this point in the history
  • Loading branch information
huard committed Jan 12, 2023
1 parent a70c46c commit e9d863a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions owslib/feature/postrequest.py
Expand Up @@ -175,8 +175,10 @@ def set_filter(self, filter):
"""
if isinstance(filter, str):
f = etree.fromstring(filter)
# If this raises an error, it means the filter string does not contain an actual Filter node.
sub_elem = f.xpath("//FES:Filter", namespaces={"FES": FES_NAMESPACE})[0]
if f.tag == util.nspath("Filter", FES_NAMESPACE):
sub_elem = f
else:
sub_elem = f.find(util.nspath("Filter", FES_NAMESPACE))

else:
sub_elem = filter
Expand Down

0 comments on commit e9d863a

Please sign in to comment.