Fixed libXml

This commit is contained in:
2023-03-01 11:30:31 +01:00
parent 773e2ac17e
commit a9dd85b3f6

View File

@@ -56,10 +56,13 @@ def xpath(source: str, xpath: str) -> str:
nsmap.pop(None)
result = root.xpath(xpath, namespaces=nsmap)
result_string = ""
for e in result:
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
return result_string
if isinstance(result, etree._ElementUnicodeResult):
return str(result)
else:
result_string = ""
for e in result:
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
return result_string