xalan_libxml_issue#283 (#299)

Reviewed-on: #299
Reviewed-by: Wojciech Szewczyk <szewczyw@noreply.example.com>
This commit is contained in:
2025-02-11 17:48:46 +01:00
parent fa620baa9c
commit 5bc89fc514
2 changed files with 16 additions and 4 deletions

View File

@@ -79,9 +79,11 @@ def xpath(source: str, xpath: str) -> str:
else:
result_string = ""
for e in result:
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
return result_string, "node"
if isinstance(e, etree._Element):
result_string += etree.tostring(e, pretty_print=True).decode() + "\n"
else:
result_string += str(e) + "\n"
return result_string, "node"
def xsd(source: str, xsd: str) -> bool: