@@ -23,7 +23,7 @@ def formatHTML(source: str, prettify: bool) -> str:
|
||||
return html.tostring(htmlDoc).decode().replace("\n", "").replace("> ", ">")
|
||||
return etree.tostring(htmlDoc, encoding='unicode', pretty_print=True)
|
||||
|
||||
def formatXML(source: str) -> str:
|
||||
def formatXML(source: str, prettify: bool) -> str:
|
||||
"""Method used to format XML
|
||||
|
||||
:param source: XML to format
|
||||
@@ -46,7 +46,10 @@ def formatXML(source: str) -> str:
|
||||
parser = etree.XMLParser(remove_blank_text=True)
|
||||
xml = etree.parse(byte_input, parser=parser)
|
||||
|
||||
return prolog + etree.tostring(xml, pretty_print=False).decode()
|
||||
if prettify:
|
||||
prolog += "\n"
|
||||
|
||||
return prolog + etree.tostring(xml, pretty_print=prettify).decode()
|
||||
|
||||
|
||||
def xpath(source: str, xpath: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user