feeds: support some exotic xpath rules returning a single string
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
ef14567d87
commit
c524e54d2d
|
@ -359,7 +359,13 @@ class ParserXML(ParserBase):
|
||||||
|
|
||||||
def rule_search_all(self, rule):
|
def rule_search_all(self, rule):
|
||||||
try:
|
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:
|
except etree.XPathEvalError:
|
||||||
return []
|
return []
|
||||||
|
|
Loading…
Reference in New Issue