Partial fix for #75 - fixes problem in libXML #92
@@ -56,10 +56,13 @@ def xpath(source: str, xpath: str) -> str:
|
|||||||
nsmap.pop(None)
|
nsmap.pop(None)
|
||||||
|
|
||||||
result = root.xpath(xpath, namespaces=nsmap)
|
result = root.xpath(xpath, namespaces=nsmap)
|
||||||
result_string = ""
|
if isinstance(result, etree._ElementUnicodeResult):
|
||||||
for e in result:
|
return str(result)
|
||||||
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
|
else:
|
||||||
return result_string
|
result_string = ""
|
||||||
|
for e in result:
|
||||||
|
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
|
||||||
|
return result_string
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user