Connected frontend and backend in formatter

This commit is contained in:
2023-02-20 14:57:32 +01:00
parent f5c8910277
commit 947e5d621e
4 changed files with 73 additions and 23 deletions

View File

@@ -3,11 +3,11 @@ from lxml import etree
def prettify(source: str) -> str:
xml = etree.XML(source)
return etree.tostring(xml, pretty_print=True)
return etree.tostring(xml, pretty_print=True).decode()
def minimize(source: str) -> str:
xml = etree.XML(source)
return etree.tostring(xml, pretty_print=False)
return etree.tostring(xml, pretty_print=False).decode()
def xpath(source: str, xpath: str) -> str: