Skip to content

Commit

Permalink
added a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonf committed Aug 30, 2023
1 parent bf1ee92 commit 9e86dd0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/search/basex_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
def check_xpath(xpath: str) -> bool:
"""Return True if a string is (only) a valid XPath, otherwise False."""
try:
# for some reason ".." isn't being properly parsed. since it's an abbreviation for
# parent::node(), we can replace it ahead of time
Parser(xpath.replace('..', 'parent::node()'), no_resolve=True)
return True
except:
Expand Down

0 comments on commit 9e86dd0

Please sign in to comment.