Partial fix for #75 - fixes problem in libXML #92

Merged
bema merged 2 commits from bema/fix/#75-libXml into master 2023-03-02 11:08:02 +01:00
Showing only changes of commit a9dd85b3f6 - Show all commits

View File

@@ -56,6 +56,9 @@ def xpath(source: str, xpath: str) -> str:
nsmap.pop(None)
result = root.xpath(xpath, namespaces=nsmap)
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"