feeds: support some exotic xpath rules returning a single string
continuous-integration/drone/push Build is passing Details

master
pictuga 2022-01-17 13:59:58 +00:00
parent ef14567d87
commit c524e54d2d
1 changed files with 7 additions and 1 deletions

View File

@ -359,7 +359,13 @@ class ParserXML(ParserBase):
def rule_search_all(self, rule):
try:
return self.root.xpath(rule, namespaces=self.NSMAP)
match = self.root.xpath(rule, namespaces=self.NSMAP)
if isinstance(match, str):
# some xpath rules return a single string instead of an array (e.g. concatenate() )
return [match,]
else:
return match
except etree.XPathEvalError:
return []