diff --git a/Backend-libXML/Parser.py b/Backend-libXML/Parser.py index 295b924..66901a6 100644 --- a/Backend-libXML/Parser.py +++ b/Backend-libXML/Parser.py @@ -2,10 +2,20 @@ from lxml import etree def prettify(source: str) -> str: + """Method used to pretty format given XML + + :param source: XML + :return: prettified XML + """ xml = etree.XML(source) return etree.tostring(xml, pretty_print=True).decode() def minimize(source: str) -> str: + """Method used to minimize XML by deleting not needed whitespaces. + + :param source: XML + :return: minimized XML + """ result = source to_remove = [" ", " ", "\t", "\n"]