Skip to content

Commit

Permalink
Merge pull request #858 from huard/fix_804
Browse files Browse the repository at this point in the history
Fix 804 previous commit for xml
  • Loading branch information
huard authored Jan 12, 2023
2 parents 6f83d02 + e9d863a commit de144a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions owslib/feature/postrequest.py
Original file line number Diff line number Diff line change
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 de144a5

Please sign in to comment.